You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/oss/langchain/tools.mdx
+37-6Lines changed: 37 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,8 @@ The following parameter names are reserved and cannot be used as tool arguments.
167
167
|`runtime`| Reserved for `ToolRuntime` parameter (accessing state, context, store) |
168
168
169
169
To access runtime information, use the @[`ToolRuntime`] parameter instead of naming your own arguments `config` or `runtime`.
170
+
171
+
If you use `InjectedState`, `InjectedStore`, `get_runtime()`, or `InjectedToolCallId`, see [Migrate from older injection patterns](#migrate-from-older-injection-patterns).
<Accordiontitle="Migrate from older injection patterns"id="migrate-from-older-injection-patterns">
628
+
629
+
Older examples used `InjectedState`, `InjectedStore`, `get_runtime()`, or `InjectedToolCallId`. Use @[`ToolRuntime`] instead for one explicit interface to state, context, store, and execution metadata.
For agent-level migrations (for example `create_react_agent` and custom state), see the [LangChain v1 migration guide](/oss/migrate/langchain-v1).
656
+
657
+
</Accordion>
658
+
:::
659
+
624
660
## Tool execution
625
661
626
662
In LangChain, tools are used by agents (for example via @[`create_agent`]) and tool error handling is configured through [middleware](/oss/langchain/middleware).
For more details on accessing state, context, and long-term memory from tools, see [Access context](#access-context).
747
-
748
-
749
780
## Dynamic tool selection
750
781
751
782
With dynamic tools, the set of tools available to the agent is modified at runtime rather than defined all upfront. Not every tool is appropriate for every situation. Too many tools may overwhelm the model (overload context) and increase errors; too few limit capabilities. Dynamic tool selection enables adapting the available toolset based on authentication state, user permissions, feature flags, or conversation stage.
0 commit comments