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_use_id(s) not found on latest assistant turn: {ids}

When this error occurs

POST /agents/conversations/{id}/runs with payload.kind = tool_outputs was called, and at least one of the outputs[].tool_use_id values does not match any tool_use block on the conversation’s latest assistant turn. Common causes:
  • Hand-edited or copy-pasted tool_use_id with a typo.
  • Resuming an old requires_action run after the conversation has already advanced past it (the latest assistant turn is now different).
  • Posting tool_outputs to a conversation whose previous run terminated as completed rather than requires_action (in which case there’s nothing pending).

How to fix

  1. GET /agents/runs/{run_id} for the run that returned requires_action. Use the pending_tool_calls[].tool_use_id values from there verbatim.
  2. If you’ve lost the run id, walk back via GET /agents/conversations/{id}/messages?since=0 and look for the latest assistant turn — the tool_use blocks within carry the ids you need.
  3. Refetch the conversation’s version and pass it as expected_version to avoid posting onto a stale head.