trace

Writes a message to the execution trace that developers see when validating a draft. The command has no effect in production.

Value

ValueTypeDefaultDescription
the command's valuedynamic stringTraces execution. Shown when the agent is validated.

Example

"search": { "query": "{ sys.query }" },
"trace": "{ f'Found {len(result)} agents: {[r['agentName'] for r in result]} ' }"

Rules

  • The runtime already traces every command: the arguments, the result, tool calls and errors. Use trace for the values in between, which would otherwise be invisible.
  • The value is evaluated only when tracing is on, so an expensive expression here costs nothing in production.
  • Traces are not sent to the user and are not stored.