# LangChain/LangGraph: stop repeated or ignored tool calls

> Discussion on WhatWorks · published 2026-11-08 · fresh until 2026-12-24 · https://whatworks.dev/t/langchain-python-agent-repeats-ignores-tools-diagnosis
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, inspect completed tool calls and matching results before choosing a model, schema or agent-control fix; contain repeated execution with `ToolCallLimitMiddleware(run_limit=2, exit_behavior="error")`

**Not for:** LangChain 0.x AgentExecutor migration; see [langchain-0-to-1-create-agent-langgraph-migration](https://whatworks.dev/t/langchain-0-to-1-create-agent-langgraph-migration.md)

Subjects: agent-workflows, openai

Inspect the model's completed tool calls and their results before changing the recursion budget, then fix the failing schema, model selection or agent control.

Do first: run `python -m pip show langchain langchain-core langchain-openai langgraph`, then capture a bounded reproduction with harmless tool substitutes and `agent.stream(inputs, config={"recursion_limit": 20}, stream_mode="updates")`. Is the model emitting no tool calls or invalid arguments, or is it repeating a valid call after receiving its result? Inspect the completed `AIMessage.tool_calls`, `invalid_tool_calls` and matching tool results in that trace.

For Python LangGraph **1.2.20**, `recursion_limit` belongs at the top level of config and counts graph super-steps, not tool executions. Twenty is an explicit diagnostic budget, not a default or a permanent fix. Follow [runtime recursion configuration](https://docs.langchain.com/oss/python/langgraph/graph-api#recursion-limit) and the [November 5 release entry](https://github.com/langchain-ai/langgraph/releases). Follow the [updates-stream example](https://docs.langchain.com/oss/python/langchain/streaming) and iterate the stream to capture the last model/tool exchange when the reproduction stops.

### Diagnostic: the agent repeats a tool or answers without using one

1. **No tool calls even for an unambiguous tool request.** On Python `langchain` **1.4.9**, `langchain-core` **1.7.6**, and `langchain-openai` **1.7.4**, isolate the model from the graph. Follow [the pinned ChatOpenAI tool-choice implementation](https://raw.githubusercontent.com/langchain-ai/langchain/langchain-openai==1.7.4/libs/partners/openai/langchain_openai/chat_models/base.py): invoke `model.bind_tools([lookup], tool_choice="lookup").invoke("Use lookup for record 7")`, substituting your tool's actual name. Use a model/provider that supports tool calling and this choice setting. **Check:** the completed response contains the expected name and valid arguments. If the direct probe fails, resolve the provider/model capability or rejected request before editing graph routing. If it succeeds, inspect the agent's actual registered tool set and instructions. Remove forced choice for normal turns: forcing a tool on every model call removes the ordinary no-tool final-answer path. The [November 4–5 releases](https://github.com/langchain-ai/langchain/releases) establish these package pins; they do not promise a fix for every model.

2. **The tool is selected, but its arguments fail validation.** On `langchain` **1.4.9**, follow [tool schema definition](https://docs.langchain.com/oss/python/langchain/tools): give each argument a type hint, give the tool a concise description, and use `@tool(args_schema=YourInput)` with a Pydantic schema when field constraints matter. Reduce the reproduction to one tool and one required argument. First call the tool directly with a valid fixture dictionary; then ask the model for that same fixture. **Check:** both paths accept the same field names and types, and the next model turn receives the tool result rather than another validation error. On `langchain-openai` **1.7.4**, the [strict-tool path](https://docs.langchain.com/oss/python/integrations/chat/openai) allows `model.bind_tools([lookup], strict=True)` for supported schemas; remove optional/defaulted fields from a strict schema. Strictness validates arguments, not whether the model chose the appropriate action.

3. **Tools disappear only when you request a structured final answer.** On `langchain` **1.4.9**, use the agent's [structured-output path](https://docs.langchain.com/oss/python/langchain/structured-output): `create_agent(model=model, tools=[lookup], response_format=Answer)` with your Pydantic `Answer` class, rather than assuming `.bind_tools(...).with_structured_output(...)` preserves previous bindings. The selected model must support tools and structured output together; choose an explicit `ToolStrategy(Answer)` or `ProviderStrategy(Answer)` when required by its capabilities. **Check:** a fixture needing external data actually calls `lookup`, receives its result and ends with `result["structured_response"]` matching `Answer`. A schema-shaped answer alone does not establish that a tool ran.

4. **The same valid tool call repeats after a result.** On `langchain` **1.4.9**, use [tool call limit middleware](https://docs.langchain.com/oss/python/langchain/middleware/built-in#tool-call-limit): import `ToolCallLimitMiddleware` from `langchain.agents.middleware` and add `ToolCallLimitMiddleware(tool_name="lookup", run_limit=2, exit_behavior="error")` to the agent's middleware list. **Check:** request that tool on three successive model turns in a harmless fixture; the third tool request must be blocked before execution. Inspect the preceding result: a repeated permanent error needs its underlying cause fixed, while a successful result needs a clear completion rule. The default `exit_behavior="continue"` feeds an error back to the model and allows more reasoning; choose `"error"` when containment must stop execution. This limits attempts, not identical argument sets. In a custom `StateGraph`, implement the equivalent guard in graph state; LangChain agent middleware is not automatically applied to arbitrary graph nodes.

5. **A custom graph calls tools but the model never sees their results.** On LangGraph **1.2.20**, follow [message state and reducers](https://docs.langchain.com/oss/python/langgraph/graph-api) and [model/tool result correlation](https://docs.langchain.com/oss/python/langchain/models). Preserve each AI message containing tool calls, then append one `ToolMessage` per executed call with the matching `tool_call_id`, and send that updated history to the next model invocation. **Check:** the trace's next model input contains the call and its corresponding result exactly once. If the model emits no tool calls but the graph still executes the tool node, repair the graph's stop routing; see graphrecursionerror-invalidupdateerror-langchain-langgraph-fixes for that error/routing case.

### Evidence and limits

Arda Akdemir's [issue #35320](https://github.com/langchain-ai/langchain/issues/35320), with February–September 2026 discussion, reports bound tools disappearing through structured-output composition. It motivates inspecting the effective bindings, not assuming the same defect affects every current configuration. `jacobreesmontgomery`'s [January 30, 2026 issue #6731](https://github.com/langchain-ai/langgraph/issues/6731) records repeated SQL tool calls on LangGraph 1.0.6; it was closed as not planned. That is not a release-backed reason to downgrade or to increase the limit.

A larger recursion budget only permits more graph work. Neither a cap nor a prompt guarantees a correct final answer, and a stopped run can leave completed side effects. Use a harmless reproduction before replaying writes. Package pins identify this recipe's API scope; provider model behavior still needs the checks above. For exception-specific recursion and concurrent-update repairs, see graphrecursionerror-invalidupdateerror-langchain-langgraph-fixes.

Not for: LangChain 0.x AgentExecutor migration; see langchain-0-to-1-create-agent-langgraph-migration.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.