What this thread does
KeyError: 'does_not_exist': check tool names against the registered schemas before invoking ValidationNode. A misspelled tool name can abort validation instead of producing the error message your retry loop expects. Do first: guard membership in node.schemas_by_name before node.invoke(...). Evidence: Joshua Brown's November 4 report establishes the exception; the implementation explains it; the guard below is an illustrative adaptation. Not for: LangGraph GraphRecursionError or InvalidUpdateError; see the graph-state error guide.
As of November 2026; checked 2026-11-08. The report names langgraph-prebuilt 1.1.1, langgraph 1.2.19 and langchain-core 1.7.5.
What changed
- This is a behavior distinction: a known tool with bad arguments can produce a validation-error
ToolMessage, while an unknown name raises before that handler. The report remains open. Issue #9592 - The October 15 prebuilt 1.1.1 release includes a
ToolNoderesume-value fix; it does not establish aValidationNodeunknown-name fix.
Do first: guard each call
For a small legacy validation node, process calls in their original order and answer every call ID, including rejected names:
from langchain_core.messages import AIMessage, ToolMessage
from langgraph.prebuilt import ValidationNode
from pydantic import BaseModel
class AddArgs(BaseModel):
a: int
node = ValidationNode(schemas=[AddArgs])
def validate_message(message: AIMessage):
replies = []
for call in message.tool_calls:
if call["name"] not in node.schemas_by_name:
replies.append(ToolMessage(
content="Unknown tool name; choose a registered tool.",
name=call["name"],
tool_call_id=call["id"],
additional_kwargs={"is_error": True},
))
continue
one = AIMessage(content="", tool_calls=[call])
replies.extend(node.invoke({"messages": [one]})["messages"])
return {"messages": replies}
This uses the node's actual registry. Pydantic classes register under schema.__name__; BaseTool instances register under schema.name. Keep the name advertised to the model aligned with that key. The source's retry example uses additional_kwargs["is_error"]. Registry and error-message convention
Diagnostic: KeyError: 'does_not_exist'
The lookup self.schemas_by_name[call["name"]] sits outside the try that catches Pydantic errors. Changing format_error cannot intercept the missing key. The node validates arguments; it does not execute tools. ValidationNode source
Limits
The upstream report covers Python 3.14.2 on macOS. The example is not a general tool-execution error handler.
ValidationNode is deprecated; the official notice recommends langchain.agents.create_agent with custom tool error handling. Treat that as a separate migration, especially for graphs using validation only for extraction.
Started from a post by @Joshua Brown (jbrown9513), packaged by the editor. Original post