Structured subagent output

DataMind Oda can ask a subagent to answer with a result that matches a fixed shape, called a schema, instead of plain text; the subagent reports it with the structured_output tool, and the run carries the recorded answer back. This page covers the call, what counts as the answer, and the cases that end without one.

How the answer is recorded

Report it once

What the schema may contain

When a run ends without the answer

The failures a subagent run can meet are collected in Subagent failures and diagnostics.

Questions, answered

How does a subagent return a structured answer?

It calls structured_output once with the finished answer. The call is acknowledged with Structured output recorded., the subagent's turn ends there, and the run's result carries the recorded answer. Plain closing text is not the answer.

What happens if the subagent calls structured_output twice?

The second call is refused with Error: structured output already recorded: the run is complete, so <tool> is not executed. The run already has its answer, and the first recorded call stands.

Can the subagent use other tools before it reports?

Yes. Calls before the recorded one still run, so it can use its tools before it reports. Only its recorded call ends the turn.

Why was the schema refused with unsupported JSON schema?

The schema asked for a feature outside the supported subset, so the run was refused before any subagent started. Reduce the schema to the supported subset and delegate again.

What happens if the subagent finishes without reporting?

The run settles as an error. A clean turn that ends without the recorded call is not accepted as a plain-text answer, and the run is not prompted again to report.

The run was cancelled and did not report either. Why is that not an error?

A cancelled run reads as cancelled, not as an error. The error is kept for a clean finish without the report, so a cancellation is never misread as a failure to answer.

What if the call's arguments do not match the schema?

The call is refused with an invalid-arguments result, and the subagent can correct the call and try again within the same turn.

Does every subagent run return a structured answer?

No. Only runs that carry an output schema. A delegation without one does not give the subagent the tool, and a target that cannot carry a schema refuses the request before the run starts. See Choosing and enabling a delegation backend.

What does the delegating side receive from a structured run?

The recorded answer, carried with the run's result, so the delegating side has a result it can check against the schema instead of free text. How a result reaches your chat depends on the run's shape; see Delegating work to subagents and Background subagents and job collection.