Intercepting AI Tool Calls: Preventing Hallucinated IDs with LangGraph MCP Middleware | Cologne .

Members-Only

Recent Talks & Demos are for members only

Exclusive feed

You must be an AI Tinkerers active member to view these talks and demos.

January 21, 2026 · Cologne

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.

Overview
Links
Tech stack
  • LangGraph
    A low-level orchestration framework for building long-running, stateful, and cyclic multi-agent systems using a graph-based architecture.
    LangGraph is the specialized, low-level runtime for developing complex AI agents, extending the LangChain ecosystem to handle intricate, stateful workflows. It models the agent's logic as a directed graph: nodes represent actions (LLM calls, tool use), and conditional edges dictate the flow, enabling critical features like cycles (loops) for iterative reasoning. This graph-based approach ensures durable execution, allowing agents to persist through failures and resume operations. Key capabilities include comprehensive memory management via a shared state object and built-in human-in-the-loop functionality (interrupts) for external oversight. This robust framework is trusted by production teams at companies like Klarna and Replit for deploying scalable, resilient agent architectures.
  • LangChain
    The open-source framework for building and deploying reliable, data-aware Large Language Model (LLM) applications.
    LangChain is the essential framework for engineering LLM-powered applications: it simplifies connecting models (like GPT-4 or Claude) to external data, computation, and APIs. The platform provides a modular set of components—Chains, Agents, Tools, and Memory—allowing developers to quickly build complex workflows like Retrieval-Augmented Generation (RAG) pipelines and sophisticated conversational agents. Its Python and JavaScript libraries, combined with LangChain Expression Language (LCEL), offer a standardized interface for rapid prototyping and moving applications to production with confidence.
  • MCP
    MCP is the open-source standard for securely connecting AI agents (like LLMs) to external tools, data, and enterprise workflows.
    The Model Context Protocol (MCP) functions as a standardized integration layer: think of it as a USB-C port for AI applications. Developed and open-sourced by Anthropic, this protocol allows large language models (LLMs) to access real-time context and execute actions via external tools like GitHub, Jira, or proprietary databases . It uses a simple JSON-RPC interface to define tools, schemas, and endpoints, which enables AI agents to perform complex, state-changing tasks—such as creating a GitHub issue or running a test script—rather than just generating text . MCP is essential for building agentic AI systems that can autonomously pursue goals and operate within defined safety and permission boundaries .
  • n8n
    n8n (pronounced 'n-eight-n') is the fair-code workflow automation platform: it gives technical teams the power of custom code (JavaScript/Python) via a visual, node-based editor.
    This is n8n: a powerful, self-hosted workflow automation platform designed for developers and technical teams. It uniquely blends the speed of a no-code UI with the flexibility of custom code, allowing users to build complex, multi-step automations that other tools cannot handle. With 400+ integrations and native AI capabilities, n8n ensures you maintain full control over your data and deployment (on-prem or cloud). For example, you can build a workflow to automatically pull data from a private API, transform it with a custom Python script, and push the results to both Salesforce and a Slack channel, all from a single visual canvas.
  • PostgreSQL
    PostgreSQL (Postgres): The world's most advanced, open-source object-relational database (ORDBMS), built for reliability and extensibility.
    PostgreSQL is the premier open-source ORDBMS, proven over 35+ years of active development. It adheres strictly to ACID properties (Atomicity, Consistency, Isolation, Durability), ensuring data integrity for mission-critical workloads. Key features include robust SQL compliance, Multi-Version Concurrency Control (MVCC), and superior extensibility (e.g., custom data types, functions in multiple languages). Advanced capabilities like native JSON/JSONB support and the PostGIS extension (geospatial data) make it a powerful, flexible choice for complex enterprise applications.

Related projects