Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

JSON Output

The --json flag wraps the agent’s output in a JSON envelope with metadata for scripting and observability.

axe run my-agent --json

Envelope Fields

FieldTypeDescription
outputstringThe agent’s text response
output_tokensintTotal output tokens across all turns
tool_callsintTotal number of tool calls made
tool_call_detailsarrayPer-call details (see below)
refusedboolWhether refusal was detected in the response
retry_attemptsintNumber of retries that occurred
budget_max_tokensintToken budget cap (only present when a budget is set)
budget_used_tokensintCumulative tokens used (only present when a budget is set)
budget_exceededboolWhether the budget was exceeded (only present when a budget is set)

tool_call_details

Each entry in the tool_call_details array represents one tool invocation:

FieldTypeDescription
namestringTool name (e.g., read_file, run_command)
inputobjectArguments passed to the tool
outputstringTool output, truncated to 1024 bytes
is_errorboolWhether the tool call resulted in an error

Example

{
  "output": "Here is the summary...",
  "output_tokens": 312,
  "tool_calls": 2,
  "tool_call_details": [
    {
      "name": "read_file",
      "input": { "path": "main.go" },
      "output": "package main\n...",
      "is_error": false
    },
    {
      "name": "run_command",
      "input": { "command": "go test ./..." },
      "output": "ok  \tgithub.com/jrswab/axe\t0.42s",
      "is_error": false
    }
  ],
  "refused": false,
  "retry_attempts": 0
}

Refusal Detection

The refused field is set to true when axe detects that the LLM declined to complete the task. Detection is heuristic — it scans the response for phrases like “I cannot”, “I’m unable to”, “I must decline”, etc. See the Refusal Detection page for details.