Agent Config

API reference for agent.json.

Agent Config

Every agent is defined by agent.json in its directory. The schema is identical for global, team-scoped, and flow-scoped agents.

Schema

{
  "name": "explorer",
  "description": "Scans the codebase and answers questions.",
  "useWhen": "User asks about code structure.",
  "tools": ["Read", "Grep", "Glob", "Bash"],
  "category": "standalone",
  "mcpServers": ["github"],
  "model": {
    "preferred": "USTC/glm-4.6",
    "fallbacks": ["USTC/glm-4.5"]
  },
  "voice": "female"
}

Fields

| Field | Type | Required | Description | |-------|------|----------|-------------| | name | string | Yes | Unique agent identifier | | description | string | Yes | One-line routing summary | | useWhen | string | No | Delegation trigger condition | | tools | string[] | No | Allowed tools (built-in + external + MCP refs) | | category | string | No | standalone / team / flow | | mcpServers | string[] | No | MCP allowlist (absent = no MCP) | | model | object | No | { preferred, fallbacks } | | voice | string | No | TTS voice preset |

Model Field

"model": {
  "preferred": "USTC/glm-4.6",
  "fallbacks": ["USTC/glm-4.5"]
}
  • preferred — the model the agent should use first
  • fallbacks — ordered fallback chain if the preferred is unavailable
  • Absent model → the agent inherits the global default model

The runtime model (possibly a fallback) is reported separately by the agent model endpoint.

Notes

  • system.md (sibling file) is the agent's system prompt — see Agent
  • External tools are resolved via $TOOL_DIR — see Tools
  • MCP tool references look like mcp__<server>__<tool>