From 5a01f74cc314ec44b1012ec370d0ed94e57f55a0 Mon Sep 17 00:00:00 2001 From: Lauren Hirata Singh Date: Thu, 20 Nov 2025 15:09:39 -0500 Subject: [PATCH 1/2] Add reserved arg names to tools --- src/oss/langchain/tools.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/oss/langchain/tools.mdx b/src/oss/langchain/tools.mdx index a67fb8d1ff..a6ebfb9e36 100644 --- a/src/oss/langchain/tools.mdx +++ b/src/oss/langchain/tools.mdx @@ -138,6 +138,26 @@ Define complex inputs with Pydantic models or JSON schemas: return result ``` + +### Reserved argument names + +The following parameter names are reserved and cannot be used as tool arguments. Using these names will cause runtime errors. + +:::python +| Parameter name | Purpose | +|----------------|---------| +| `config` | Reserved for passing `RunnableConfig` to tools internally | +| `runtime` | Reserved for `ToolRuntime` parameter (accessing state, context, store) | + +To access runtime information, use the @[`ToolRuntime`] parameter instead of naming your own arguments `config` or `runtime`. +::: + +:::js +| Parameter name | Purpose | +|----------------|---------| +| `config` | Reserved for passing runtime context and configuration to tools | + +To access runtime configuration, use the `config` parameter as the second argument to your tool function (not in the schema). ::: ## Accessing Context From 8a9e645811b99ff989756d914bfb99fc193189ec Mon Sep 17 00:00:00 2001 From: Lauren Hirata Singh Date: Thu, 20 Nov 2025 16:13:10 -0500 Subject: [PATCH 2/2] remove js section --- src/oss/langchain/tools.mdx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/oss/langchain/tools.mdx b/src/oss/langchain/tools.mdx index a6ebfb9e36..8f8e49ec69 100644 --- a/src/oss/langchain/tools.mdx +++ b/src/oss/langchain/tools.mdx @@ -139,11 +139,11 @@ Define complex inputs with Pydantic models or JSON schemas: ``` +:::python ### Reserved argument names The following parameter names are reserved and cannot be used as tool arguments. Using these names will cause runtime errors. -:::python | Parameter name | Purpose | |----------------|---------| | `config` | Reserved for passing `RunnableConfig` to tools internally | @@ -152,14 +152,6 @@ The following parameter names are reserved and cannot be used as tool arguments. To access runtime information, use the @[`ToolRuntime`] parameter instead of naming your own arguments `config` or `runtime`. ::: -:::js -| Parameter name | Purpose | -|----------------|---------| -| `config` | Reserved for passing runtime context and configuration to tools | - -To access runtime configuration, use the `config` parameter as the second argument to your tool function (not in the schema). -::: - ## Accessing Context