# How to use ToolRuntime in arg\_schema for a tool

**URL:** <https://forum.langchain.com/t/how-to-use-toolruntime-in-arg-schema-for-a-tool/2549>\
**Category:** LangGraph\
**Tags:** python-help\
**Created:** [December 18, 2025, 7:42am UTC](https://forum.langchain.com/t/how-to-use-toolruntime-in-arg-schema-for-a-tool/2549 "2025-12-18T07:42:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neel](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@neel](https://forum.langchain.com/u/neel)\
**Post date:** [December 18, 2025, 7:42am UTC](https://forum.langchain.com/t/how-to-use-toolruntime-in-arg-schema-for-a-tool/2549/1 "2025-12-18T07:42:13Z")

</div>

Hi all,

While declaring a tool, I’m using the args\_schema field to annotate each argument of the tool properly. In the older verion of the langchain and langgraph, I was suppossed to use `Annotated[state, InjectedState]` syntax to pass the state inside the tool, similar for config as well. But after the introduction of `Context` and `ToolRuntime`, I’m using the tool runtime in my tool.

The issue is, I can’t pass the ToolRuntime in the pydantic model with or without annotated key, and thus it throws an error. With pydantic it is easier to provide the tool context and arguments details in a different manner.

Please let me know what I can do?

---

<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 18, 2025, 10:53pm UTC](https://forum.langchain.com/t/how-to-use-toolruntime-in-arg-schema-for-a-tool/2549/2 "2025-12-18T22:53:13Z")

</div>

hi @neel

There already was a discussion on that matter… Have you tried to search the forum?  
Could you share some code of the scenarios you have tried? Something might have changed in the latest versions so I could retest
