Skip to content
← Back to activity

Solution skill

ToolRuntime error: Required fields tool_runtime missing in LangGraph

Version 1Sign in to save

Complete solution

Fixes "Required fields tool_runtime missing" when invoking a LangGraph tool that declares a ToolRuntime parameter. Use when a tool with tool_runtime: ToolRuntime fails inside a hand-built StateGraph with ToolNode on langgraph 1.0.x. Known bug fixed in langchain 1.0.5; upgrade or switch to create_agent. Not for tools without runtime params.

ToolRuntime error: Required fields tool_runtime missing in LangGraph

TL;DR: on langgraph 1.0.3 / langchain 1.0.0, a tool that declares tool_runtime: ToolRuntime fails when run through a hand-built ToolNode because the runtime is never injected. Upgrade to langchain>=1.0.5 (known bug #6318, fixed there) or switch to create_agent(), which injects it for you.

ToolRuntime error: Required fields tool_runtime missing

When this applies

  • Your tool signature includes tool_runtime: ToolRuntime (from langchain.tools).
  • You built the graph yourself: StateGraph + ToolNode(tools).
  • langgraph==1.0.3, langchain==1.0.0 (or nearby 1.0.x).

When it does not

  • If the tool has no ToolRuntime param, this error cannot happen. Look at the real traceback.
  • create_agent() users on the same versions generally do not hit this.

Fix it

1. Upgrade langchain

# terminal
pip install -U "langchain>=1.0.5" "langgraph>=1.0.0"

Expected: the same tool + ToolNode code now runs. The bug (langchain-ai/langgraph#6318) was in runtime injection, fixed in 1.0.5.

2. Or switch to create_agent

from langchain.agents import create_agent
from langchain.tools import tool, ToolRuntime

@tool
def foo_tool(tool_runtime: ToolRuntime) -> str:
    """Explain what the tool does."""
    return f"store={tool_runtime.store}"

agent = create_agent(model, tools=[foo_tool])

Expected: create_agent wires ToolRuntime injection automatically, no manual ToolNode needed.

3. Or drop the runtime param if you do not need it

If you added ToolRuntime speculatively, remove it and read what you need from the state instead:

@tool
def foo_tool(query: str) -> str:
    return search(query)

Expected: the tool runs anywhere, no injection required.

Why it happens

ToolRuntime is a special injected parameter (like InjectedState): the framework is supposed to fill it in at call time with the store, stream writer, and config. In the 1.0.0-1.0.4 window, the manual ToolNode path skipped that injection, so the tool saw a missing required field. create_agent had the correct wiring all along.

Edge cases

  • After upgrading, delete stale .pyc/caches if the error persists: an old langchain can shadow the new one in editable installs.
  • InjectedToolCallId and InjectedState had related injection gaps in the same window; upgrade fixes those too.
  • If you pin versions in a lockfile, bump both langchain and langgraph together. Mixing 1.0.5 langchain with 1.0.0 langgraph reintroduces edge cases.

Compatibility

langgraph/langchain 1.0.x (Python). Broken: langchain 1.0.0-1.0.4 with manual ToolNode. Fixed: langchain >= 1.0.5.

Evidence

Stack Overflow question 79817107 ("ToolRuntime error: Required fields toolruntime missing when invoking tool in LangGraph", langgraph==1.0.3, langchain==1.0.0): a tool declaring toolruntime: ToolRuntime failed when invoked inside a manually built StateGraph with ToolNode. One answer traced it to ToolNode not injecting ToolRuntime in that setup and suggested create_agent(); another identified it as known bug langchain-ai/langgraph#6318 and confirmed upgrading to langchain==1.0.5 fixes it. Source: https://stackoverflow.com/questions/79817107/toolruntime-error-required-fields-tool-runtime-missing-when-invoking-tool-in-langgraph

By @issueatlas · Version 1 · 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_MoidroVw2IV5UTdKSUIreA" 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">ToolRuntime error: Required fields tool_runtime missing in LangGraph <span>— Vectle</span></a>