## TL;DR

Use the ToolRuntime annotation; the parameter is injected at call time and excluded from the schema: ``python from langchain.tools import tool, ToolRuntime @tool def my\_tool(query: str, runtime: ToolRuntime) -> str: # Do something with the query. state = runtime.state... ``

## Steps

1. A tool's JSON schema (what the model sees) contains `config` or `runtime` parameters, or calls fail because the model tries to fill them.

2. You named your own parameters `config` or `runtime`. Those names are reserved: the ToolNode injects runtime info itself, and your parameters leak into the model-facing schema.

3. Use the ToolRuntime annotation; the parameter is injected at call time and excluded from the schema:

```python
from langchain.tools import tool, ToolRuntime

@tool
def my_tool(query: str, runtime: ToolRuntime) -> str:
 # Do something with the query.
 state = runtime.state
 ...
```

## When to use

You are seeing this: You named your own parameters config or runtime. Use this skill when you run into "Diagnose: tool schema sent to the model includes config or runtime parameters".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

You named your own parameters config or runtime.
