Built-in tools
Call contracts for the two built-in tools: emit_output (terminates autonomous runs) and reason (typed think-step inference), with every error code.
Last updated
Was this helpful?
Call contracts for the two built-in tools: emit_output (terminates autonomous runs) and reason (typed think-step inference), with every error code.
Context — The runtime ships two synthetic tools under the
built-innamespace. Authors normally meet them through routine syntax (think:steps; autonomous terminal steps); this page is the exact call contract — what the model is asked to supply and every result the handler can return.
Both tools take nested JSON as a JSON-encoded string parameter (output_json) — tool parameters are primitive-typed, so objects are marshalled through strings. Both return {"ok": true, ...} on success and {"ok": false, "error": <code>, ...} on failure; a failed call is visible to the model, which can retry with corrected output within the turn's iteration budget.
built-in:emit_outputTerminates an autonomous run with its typed result. Every terminal node of an autonomous routine (a node with no outbound transitions) must be a TOOL node calling it.
output_json
string (JSON-encoded object)
The run's final output. Must parse as JSON and validate against the routine's output_schema (tightened with additionalProperties: false).
On success the run transitions to succeeded and the callback watcher fires. Schema violations transition the run to failed with error code output_validation_failed (the callback's error.details carries the violating path).
Result error
Meaning
output_validation_failed
output_json didn't parse, or violated output_schema — the run fails.
not_an_autonomous_run
Called in a session that isn't an autonomous run.
routine_not_registered
Session metadata names a routine the runtime doesn't know.
session_not_found
The session disappeared mid-run.
not_configured
Autonomous runtime not wired (server misconfiguration).
Usage in a routine:
- id: finish
tools: built-in:emit_output
tool_instruction: >
Call emit_output with output_json set to a JSON object
containing exactly the decision and explanation fields
produced by the assess node.built-in:reasonBacks the think: node kind — typed structured inference that does not end the turn. The loader compiles each think: + output_schema: node into a TOOL node calling this tool with the node's id baked into the instruction.
step_id
string
The think node's id (the parameter keeps its historical wire name; the value is compiled into the node's instruction — not chosen at runtime).
output_json
string (JSON-encoded object)
The inference result. Must validate against the node's output_schema (tightened with additionalProperties: false).
On success the validated object is merged into session.metadata.step_outputs[<node-id>] and returned in the tool result, so downstream steps see the typed fields in history.
Result error
Meaning
output_validation_failed
output_json didn't parse or violated the node's schema — the model can correct and retry.
missing_step_id
Empty step_id argument.
step_not_registered
No output_schema registered for this routine + node id.
routine_not_resolved
The session has no routine_id metadata. Autonomous runs set it automatically, so this indicates a misconfiguration.
session_not_found
The session disappeared.
persist_failed
Writing step_outputs to the session failed.
not_configured
Reason-step registry not wired (server misconfiguration).
Authoring guidance for think nodes (autonomous routines only): Autonomous routines.
Last updated
Was this helpful?
Was this helpful?

