High severity intermediate · Fix: 5-10 min

ToolCallResultNotSubmittedRunError

langchain_core.chains.base.ToolCallResultNotSubmittedRunError

What this error means
This error occurs when a function-calling chain expects a tool call result to be submitted but it was not, causing the run to fail.

Stack trace

traceback
langchain_core.chains.base.ToolCallResultNotSubmittedRunError: Tool call result was not submitted during the run, causing execution to halt.
QUICK FIX
Ensure your tool function returns a valid result and that the chain submits this result explicitly during the run.

Why it happens

In function-calling chains, the framework expects the tool call result to be explicitly submitted back to the chain runner. If the tool call result is missing or not returned properly, the chain cannot continue and raises this error. This often happens when the tool function does not return the expected output or the chain logic does not handle the tool response correctly.

Detection

Monitor chain execution logs for missing tool call results and catch ToolCallResultNotSubmittedRunError exceptions to log the incomplete tool response before failure.

Causes & fixes

1

The tool function does not return any result or returns None

✓ Fix

Ensure the tool function returns a valid result object or string that the chain expects.

2

The chain logic does not submit the tool call result back to the runner

✓ Fix

Modify the chain or callback handler to explicitly submit the tool call result after execution.

3

Mismatch between expected tool output format and actual returned data

✓ Fix

Align the tool output format with the chain's expected schema or parsing logic.

Code: broken vs fixed

Broken - triggers the error
python
from langchain_core.chains import Tool

def my_tool(input_text):
    # Missing return statement causes no result submission
    print(f'Processing: {input_text}')

# This will raise ToolCallResultNotSubmittedRunError
result = my_tool('test input')  # error here
print(result)
Fixed - works correctly
python
import os
from langchain_core.chains import Tool

os.environ['LANGCHAIN_API_KEY'] = os.environ.get('LANGCHAIN_API_KEY', '')  # Use env var for keys

def my_tool(input_text):
    # Return a valid result string to submit
    return f'Processed: {input_text}'

result = my_tool('test input')  # fixed: returns result
print(result)  # prints 'Processed: test input'
Added a return statement in the tool function to ensure the tool call result is submitted back to the chain runner, preventing the error.

Workaround

Wrap the tool call in try/except ToolCallResultNotSubmittedRunError, and if caught, manually construct and submit a fallback result to allow the chain to continue.

Prevention

Design tool functions to always return a valid result and implement chain callbacks that verify and submit tool call results explicitly to avoid missing submissions.

Python 3.9+ · langchain-core >=0.1.0 · tested on 0.2.x
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.