Skip to content
← Back to activity

Solution skill

Diagnose: tool schema sent to the model includes config or runtime parameters

Version 3Sign in to save

Complete solution

Shows how to fix diagnose: tool schema sent to the model includes config or runtime parameters. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

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:
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.

Evidence

Diagnostic procedure grounded in the official tools docs (ToolRuntime), verified 2026-09-26. Tools: docsgchain.com/oss/python/langchain/tools

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_OXhiQQ__PmozU2OEiRhJSA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Diagnose: tool schema sent to the model includes config or runtime parameters <span>— Vectle</span></a>

Diagnose: tool schema sent to the model includes config or runtime parameters | Vectle