# Forcing tool calls in Langchain/Langgraph v1 create\_agent

**URL:** <https://forum.langchain.com/t/forcing-tool-calls-in-langchain-langgraph-v1-create-agent/1898>\
**Category:** LangGraph\
**Tags:** python-help\
**Created:** [October 22, 2025, 9:23am UTC](https://forum.langchain.com/t/forcing-tool-calls-in-langchain-langgraph-v1-create-agent/1898 "2025-10-22T09:23:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iss44](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@iss44](https://forum.langchain.com/u/iss44)\
**Post date:** [October 22, 2025, 9:23am UTC](https://forum.langchain.com/t/forcing-tool-calls-in-langchain-langgraph-v1-create-agent/1898/1 "2025-10-22T09:23:59Z")

</div>

Hi,

Before Langgraph v1, developers could force tool use in create\_react\_agent by passing a bound llm model with

`bind_tools( tools=tools, tool_choice="any", parallel_tool_calls=False )`

However since LangGraph/Langchain v1, bound models are not supported in create\_agent.

Is there a way we can force a create\_agent to always call tools?

---

<div class="post-metadata">

**Author:** ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)\
**Post date:** [October 22, 2025, 10:43am UTC](https://forum.langchain.com/t/forcing-tool-calls-in-langchain-langgraph-v1-create-agent/1898/2 "2025-10-22T10:43:25Z")

</div>

Hi @iss44

have you tried middlewares?

```py
from typing import Callable, Awaitable

from dotenv import load_dotenv
from langchain.agents import create_agent
from langchain.agents.middleware import wrap_model_call, ModelRequest, ModelResponse
from langchain.chat_models import init_chat_model
from langchain.tools import ToolRuntime
from langchain_core.messages import HumanMessage
from langchain_core.tools import tool
from pydantic import BaseModel, ConfigDict

load_dotenv(verbose=True)

llm = init_chat_model(
    "claude-3-7-sonnet-latest"
)

class MyToolInput(BaseModel):
    # Allow ToolRuntime (which contains BaseStore, etc.)
    model_config = ConfigDict(arbitrary_types_allowed=True)

    query: str
    runtime: ToolRuntime # injected; hidden from the model

@tool(args_schema=MyToolInput, description="Ask for additional information")
def my_mood(query: str, runtime: ToolRuntime) -> str:
    print(f"My Mood query: {query}")
    return f"So so today"

@wrap_model_call
def force_tools(request: ModelRequest, handler: Callable[[ModelRequest], Awaitable[ModelResponse]]):
    msgs = request.messages # excludes system prompt
    is_first_llm_step = len(msgs) > 0 and isinstance(msgs[-1], HumanMessage)
    if is_first_llm_step:
        request = request.override(
            tool_choice={"type": "tool", "name": "my_mood"},
            model_settings={"parallel_tool_calls": False},
        )
    return handler(request)

agent = create_agent(
    model=llm, # Chat model instance (not pre-bound)
    tools=[my_mood], # Tools available to the agent
    middleware=[force_tools],
)

answer = agent.invoke({"messages": [HumanMessage("Hi!")]}, config={"recursion_limit": 10})

for msg in answer["messages"]:
    msg.pretty_print()

```

---

<div class="post-metadata">

**Author:** ![iss44](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@iss44](https://forum.langchain.com/u/iss44)\
**Post date:** [October 22, 2025, 9:05pm UTC](https://forum.langchain.com/t/forcing-tool-calls-in-langchain-langgraph-v1-create-agent/1898/3 "2025-10-22T21:05:38Z")

</div>

Thanks @pawel-twardziak that’s an elegant solution
