Members-Only
Recent Talks & Demos are for members only
You must be an AI Tinkerers active member to view these talks and demos.
LangGraph Tool Call Middleware
This talk details a production middleware pattern using LangGraph to intercept and correct hallucinated workflow IDs in LLM tool calls before execution.
Live walkthrough of a production middleware pattern that intercepts LLM tool calls before execution to inject correct workflow IDs, preventing hallucinated values.
The demo covers:
The problem: LLMs hallucinate workflow IDs when calling n8n tools via MCP
The solution: WorkflowInjectorToolNode wrapping LangGraph’s ToolNode to intercept and modify tool calls
Implementation details: how to modify AIMessage.tool_calls before execution, handle edge cases, and maintain compatibility with LangGraph’s tool matching
Trade-offs: when to use middleware vs. prompt engineering vs. tool design
Includes real code from a production agent system, showing the interception logic, error handling, and integration with LangGraph’s checkpointing system.