Context
This error only occurs when running the graph via langgraph dev command.
The same code works correctly with FastAPI hosting.
Problem
LangGraph CLI incorrectly attempts to validate InjectedState parameters in tool schemas.
When using a typed state class (e.g., AgentState), the validation layer treats
injected state parameters as required tool arguments and fails.
Workaround
Use generic dict type instead of custom state class:
Before: state: Annotated[AgentState, InjectedState]
After: state: Annotated[dict, InjectedState]
This bypasses field-level validation while maintaining state injection functionality.
Trade-offs
- Loss of type safety and IDE autocomplete for state fields
- Manual type checking required when accessing state properties
- Increased risk of runtime errors from typos or missing fields
You can view Langsmith trace here: LangSmith
I’ve created a detailed gh issue (with reproduction example) at : langgraph#6241