Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.narrative.io/llms.txt

Use this file to discover all available pages before exploring further.

HTTP status: 400

Error message

tool_outputs do not match the pending client tool calls — missing: {ids}; unexpected: {ids}
(One or both of the missing/unexpected clauses may be omitted if that side is empty.)

When this error occurs

When resuming a requires_action run, every entry in pending_tool_calls from the prior run must have a matching entry in the new run’s payload.outputs, and there must be no extra entries beyond those. The API enforces a strict 1:1 match. The two cases:
  • Missing — a pending client tool call has no corresponding output. The model can’t continue without all results.
  • Unexpected — an output references a tool_use_id that is a client call but isn’t in the current pending set. Usually means resuming with a payload that targets an older requires_action state.

How to fix

  1. GET /agents/runs/{prior_run_id} and copy the entire pending_tool_calls array verbatim.
  2. Produce exactly one outputs[] entry per pending_tool_calls[] entry — same tool_use_id, same count.
  3. Refetch expected_version before posting to avoid version_conflict.
If a tool call’s result truly is unavailable (e.g. user dismissed the prompt), still post an output with is_error: true and a short message — the model can then choose how to proceed.