# I am gonna use langchain builtin middleware in custom state graph

**URL:** <https://forum.langchain.com/t/i-am-gonna-use-langchain-builtin-middleware-in-custom-state-graph/2414>\
**Category:** LangGraph\
**Tags:** intro-to-langgraph, python-help\
**Created:** [December 4, 2025, 9:12am UTC](https://forum.langchain.com/t/i-am-gonna-use-langchain-builtin-middleware-in-custom-state-graph/2414 "2025-12-04T09:12:46Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [December 12, 2025, 3:20pm UTC](https://forum.langchain.com/t/i-am-gonna-use-langchain-builtin-middleware-in-custom-state-graph/2414/9 "2025-12-12T15:20:33Z")

</div>

I’m attaching the link here as the follow up

> [@Implement ToolLimitationNode in stateGraph](https://forum.langchain.com/t/implement-toollimitationnode-in-stategraph/2502):
>
> I have one significant challenge to implement the ToolCallLimitMiddleware I set the tool call limit to 5. When I ask the LLM to create 6 images, the assistant returns: tool\_calls = [call1, call2, call3, call4, call5, call6] What I want is to execute only the first 5 tool calls, ignore the 6th, and then return control to the LLM. However, with my current implementation using ToolCallLimitMiddleware, all 6 tool calls are executed sequentially, and the middleware only triggers after the 6th c…

---

_[View the full topic](https://forum.langchain.com/t/i-am-gonna-use-langchain-builtin-middleware-in-custom-state-graph/2414)._
