Expand description
Tool abstraction.
Both builtin tools (defect-tools) and MCP adapters (defect-mcp) integrate
into the agent main loop by implementing the Tool trait.
§ACP alignment
Tool::describe and ToolEvent::Progress / ToolEvent::Completed
directly reuse ACP’s ToolCallUpdateFields to avoid duplicating fields.
The main loop enriches the fields produced by the tool with metadata such as
ToolCallId and raw_input, then forwards them as session/update and
session/request_permission.
Structs§
- Cancel
Background Task Tool - Cancel a single background task early.
- Goal
Done Tool - The
goal_donetool. Registered during--goalassembly; stateless (the flag lives on the sharedGoalStateinToolContext::goal, this tool only callsmark_reached). - Inspect
Background Task Tool - Query the status and progress of a background task. Without
task_id, list all tasks; with it, query the most recent message block for a single task. - Skill
Entry - A skill that can be loaded by the
skilltool (agent-side representation). - Skill
Tool - The
skilltool. It is registered onStaticToolRegistryand shared across sessions of the owningAgentCoreviaprocess_tools(it is not a process-global singleton—a single process may host multipleAgentCoreinstances, each with its own skill index). - Skill
Triggers - Auto-activation triggers for a skill (the
triggerssub-table of the Agent Skills open-standard). - Spawn
Agent Tool - The
spawn_agenttool. It is registered onStaticToolRegistryand shared across sessions of the owningAgentCoreviaprocess_tools(it is not a process-global singleton — a single process may host multipleAgentCoreinstances, each with its own copy). At construction time it captures everything needed to run a nested turn, becauseToolContextonly carries cwd/fs/shell/http/cancel/current_model, not the provider registry, policy, or tool set. - Subagent
Bridge - A handle for bridging sub-turn events (spawned internally by a tool) back into the parent session’s event stream.
- Subagent
Profile - A subagent profile that can be invoked by
spawn_agent(agent-side representation). - Tool
Call Description - Self-description of a tool call, directly mapping to ACP’s
ToolCallUpdateFields. - Tool
Context - The execution environment injected into
Tool::execute. - Tool
Schema - Tool’s “public face”: describes the parameter shape without any execution capability.
Enums§
- Safety
Class - Safety level for a tool.
- Tool
Error - Tool execution error.
- Tool
Event - Elements of the event stream produced by
Tool::execute.
Constants§
- GOAL_
DONE_ TOOL_ NAME - The name of the
goal_donetool.
Traits§
- Tool
- Tools callable by the agent.
Type Aliases§
- Tool
Stream - Event stream for
Tool::execute. Type-erased so thatdyn Toolcan be used directly.