Skip to main content

Module tool

Module tool 

Source
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§

CancelBackgroundTaskTool
Cancel a single background task early.
GoalDoneTool
The goal_done tool. Registered during --goal assembly; stateless (the flag lives on the shared GoalState in ToolContext::goal, this tool only calls mark_reached).
InspectBackgroundTaskTool
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.
SkillEntry
A skill that can be loaded by the skill tool (agent-side representation).
SkillTool
The skill tool. It is registered on StaticToolRegistry and shared across sessions of the owning AgentCore via process_tools (it is not a process-global singleton—a single process may host multiple AgentCore instances, each with its own skill index).
SkillTriggers
Auto-activation triggers for a skill (the triggers sub-table of the Agent Skills open-standard).
SpawnAgentTool
The spawn_agent tool. It is registered on StaticToolRegistry and shared across sessions of the owning AgentCore via process_tools (it is not a process-global singleton — a single process may host multiple AgentCore instances, each with its own copy). At construction time it captures everything needed to run a nested turn, because ToolContext only carries cwd/fs/shell/http/cancel/current_model, not the provider registry, policy, or tool set.
SubagentBridge
A handle for bridging sub-turn events (spawned internally by a tool) back into the parent session’s event stream.
SubagentProfile
A subagent profile that can be invoked by spawn_agent (agent-side representation).
ToolCallDescription
Self-description of a tool call, directly mapping to ACP’s ToolCallUpdateFields.
ToolContext
The execution environment injected into Tool::execute.
ToolSchema
Tool’s “public face”: describes the parameter shape without any execution capability.

Enums§

SafetyClass
Safety level for a tool.
ToolError
Tool execution error.
ToolEvent
Elements of the event stream produced by Tool::execute.

Constants§

GOAL_DONE_TOOL_NAME
The name of the goal_done tool.

Traits§

Tool
Tools callable by the agent.

Type Aliases§

ToolStream
Event stream for Tool::execute. Type-erased so that dyn Tool can be used directly.