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

Tool System

How agents define, register, expose, and execute tools.

The Universal Tool Shape

Every agent defines tools with the same interface:

Tool {
  name: string
  description: string
  parameters: JSONSchema
  execute(params) → result
}
AgentType NameExtras
PiAgentTool<TParameters>label, executionMode (sequential/parallel)
GooseTool (rmcp)ToolAnnotations (read_only, destructive, idempotent, open_world)
Grok BuildToolDefinitionToolKind, ToolNamespace, versioned descriptions
Kimi CodeExecutableToolPer-step dynamic rebuild via buildTools()
OpenCode/KilocodeEffect-TS ToolToolRegistry service, codec-validated
ClineAgentToolzodToJsonSchema for schema generation
Qwen CodeSame as OpenCodetool-search for dynamic MCP discovery

Tool Surface by Agent

AgentTotal ToolsStrategy
Codex~3Minimal: patch + plan + shell
Pi~4-6Core set: read, bash, edit, write + skills
Cline~6read_files, run_commands, search_codebase, edit_file, apply_patch, submit_and_exit
Goose0 built-inAll via MCP extensions (platform tools: schedule only)
Grok Build~25Rich built-in set per toolset variant (grok_build, grok_build_hashline, grok_build_concise)
OpenCode/Kilocode~20read, edit, write, bash, grep, glob, ls, web-fetch, web-search, skill, todowrite, apply-patch, enterPlanMode, exitPlanMode
Kimi CodedynamicTool set determined at runtime by session config
Qwen Code~60+Largest surface: all of OpenCode + monitor, cron, workflow, agent, team-*, artifact, notebook-edit, image-gen, lsp, tool-search, loop-wakeup, enter/exit-worktree, send-message

Tool Protocol: Where Tools Come From

  • Built-in only: Codex, Pi — all tools are compiled into the binary
  • Built-in + MCP optional: Grok Build, Qwen Code, OpenCode/Kilocode, Cline — core tools built-in, MCP extends
  • MCP-native: Goose — ALL tools come from extensions via MCP. No built-in coding tools.

Tool Execution: Sequential vs Parallel

AgentDefaultControl
PiConfigurablePer-tool executionMode field
GooseSequentialNo parallel option
Grok BuildParallel encouragedPrompt instructs “parallelize independent calls”
ClineParallel encouragedPrompt instructs “emit all independent calls now”
Qwen CodeParallelStandard multi-tool-call support
CodexParallelmulti_tool_use.parallel

Tool Annotations/Metadata

Goose is unique in having rich tool annotations:

#![allow(unused)]
fn main() {
ToolAnnotations {
    title: String,
    read_only: bool,
    destructive: bool,
    idempotent: bool,
    open_world: bool,
}
}

This enables the permission system to auto-classify tools without LLM calls for simple cases.

Dynamic Tool Loading

Agents that change available tools mid-session:

  • Kimi Code: buildTools() re-invoked before every step (tools loaded mid-turn are immediately available)
  • Qwen Code: tool-search lets the model discover MCP tools on demand
  • Goose: Extensions can be enabled/disabled mid-conversation
  • Grok Build: Different toolset variants (hashline vs standard) per agent definition