langchain-ai/langgraph · error · ToolInvocationError

Tool invocation failed validation

Error message

Tool {name} invocation failed validation: {args}

What it means

The tool call's arguments failed schema validation at invocation time: tool.invoke raised an input-validation error for the args produced by the LLM. This surfaces malformed or schema-incompatible arguments the model generated for the named tool.

Solutions

  1. Tighten the tool's args_schema (add constraints/defaults) so LLM outputs validate
  2. Enable handle_tool_errors so the validation error is returned to the LLM as a ToolMessage for self-correction
  3. Add few-shot examples or improve the tool docstring so the model emits valid arguments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at libs/prebuilt/langgraph/prebuilt/tool_node.py:964 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26). Data as JSON: /api/errors/533d1c999508b27d. Report an issue: GitHub.

Appendix: source

Thrown at libs/prebuilt/langgraph/prebuilt/tool_node.py:964

            if invalid_tool_message := self._validate_tool_call(call):
                return invalid_tool_message
            # This should never happen if validation works correctly
            msg = f"Tool {call['name']} is not registered with ToolNode"
            raise TypeError(msg)

        # Inject state, store, and runtime right before invocation
        injected_call = self._inject_tool_args(call, request.runtime, tool)
        call_args = {**injected_call, "type": "tool_call"}

        try:
            try:
                response = tool.invoke(call_args, config)
            except ValidationError as exc:
                # Filter out errors for injected arguments
                injected = self._injected_args.get(call["name"])
                filtered_errors = _filter_validation_errors(exc, injected)
                # Use original call["args"] without injected values for error reporting
                raise ToolInvocationError(
                    call["name"], exc, call["args"], filtered_errors
                ) from exc

            # Inside try so validation errors route through _handle_tool_errors
            return self._normalize_tool_response(
                response, request.tool_call, input_type
            )

        # GraphInterrupt is a special exception that will always be raised.
        # It can be triggered in the following scenarios,
        # Where GraphInterrupt(GraphBubbleUp) is raised from an `interrupt` invocation
        # most commonly:
        # (1) a GraphInterrupt is raised inside a tool
        # (2) a GraphInterrupt is raised inside a graph node for a graph called as a tool
        # (3) a GraphInterrupt is raised when a subgraph is interrupted inside a graph
        #     called as a tool
        # (2 and 3 can happen in a "supervisor w/ tools" multi-agent architecture)
        except GraphBubbleUp:

View on GitHub (pinned to 38031739e5)