skills/a0-development/references/tools.md
/a0/helpers/tool.py/a0/tools/AGENTS.md/a0/agent.py/a0/tools/skills_tool.py/a0/agents/_example/tools/example_tool.py/a0/prompts/AGENTS.mdAll tools derive from helpers.tool.Tool and implement:
from helpers.tool import Tool, Response
class MyTool(Tool):
async def execute(self, **kwargs) -> Response:
return Response(message="done", break_loop=False)
Response fields:
| Field | Meaning |
|---|---|
message | Text appended as the tool result and shown back to the agent. |
break_loop | True stops the current message loop. |
additional | Optional metadata added with the tool result. |
Tool instances receive agent, name, method, args, message, and loop_data. Use self.method for method-style tools such as skills_tool:load.
| Location | Use |
|---|---|
tools/ | Core framework tools. Use only for bundled framework behavior. |
plugins/<plugin>/tools/ | Bundled plugin tools. |
usr/plugins/<plugin>/tools/ | User plugin tools. This is the preferred place for custom plugin work. |
agents/<profile>/tools/ | Profile-local tools. Verify current discovery before relying on profile examples. |
Most new tools should be packaged in a plugin, not added directly to root tools/.
Every tool needs an agent-facing prompt fragment so the model knows the tool name, JSON shape, arguments, and when to use it.
Common locations:
prompts/agent.system.tool.<tool_name>.mdplugins/<plugin>/prompts/agent.system.tool.<tool_name>.mdusr/plugins/<plugin>/prompts/agent.system.tool.<tool_name>.mdagents/<profile>/prompts/agent.system.tool.<tool_name>.mdWhen changing a tool name, argument shape, output behavior, safety rule, or break_loop behavior, update its prompt and tests together.
await self.set_progress(...) when progress should be visible through the tool-output update extension.self.add_progress(...) only accumulates local progress text.tools/AGENTS.md and use await self.agent.handle_intervention(...) where pause/intervention flow matters.Direct files under tools/*.py require matching tools/*.py.dox.md. The companion file owns purpose, arguments, output, break_loop, side effects, prompt contract notes, dependencies, and verification.
Plugin tool documentation belongs in that plugin's docs or DOX contract, not in root tools/.
tools/*.py has a matching .py.dox.md.AGENTS.md.