Tool Spec
The format and content of a TOOL.md file. The technical specification that the agent reads to understand a tool's contract.
Purpose
This page documents the format and content of a
TOOL.md file. A TOOL.md is the technical
specification that the agent reads to understand a
tool's contract: what it does, how to invoke it, what
it returns, and what can go wrong.
A TOOL.md is required for every tool in the lab. The
format is consistent across all tools; this makes it
easy for the agent to read a new tool's TOOL.md and
know what to expect.
Required sections
Every TOOL.md must have the following sections:
- Title and short description.
- Purpose. A one-paragraph description of what the tool does.
- Commands. The CLI commands the tool supports.
- Inputs. The inputs each command takes.
- Outputs. The outputs each command returns.
- Data flow. A diagram or description of how the tool processes the inputs.
- Configuration. The configuration the tool requires.
- Dependencies. The tool's dependencies.
- Tests. How the tool is tested.
- Failure modes. What can go wrong and how to recover.
Optional sections include:
- Examples. Usage examples.
- Limitations. Known limitations.
- References. Links to related docs.
Template
Example: torrent-finder TOOL.md
A real-world example. torrent-finder searches for
movies/series via BitTorrent.
SKILL.md
The SKILL.md file is the activation file. It is
loaded by the Coordinator's skill loader when the
user's request matches the skill's trigger phrases.
The format is:
The name and description fields in the YAML
frontmatter are the trigger phrases the Coordinator
uses. The body is the workflow the Coordinator
follows.
Tests
The tool's tests live in tests/. The test conventions:
- One test file per module.
test_main.pyformain.py,test_lib.pyforlib.py, etc. - Use
pytest. The test runner ispytest. - Mock external dependencies. HTTP calls, file I/O, and subprocess calls are mocked.
- Cover the happy path and the failure paths. Every command is tested for both success and failure.
- Use fixtures for shared setup. The
conftest.pyfile holds the shared fixtures.
The test target is 70% coverage minimum.
Adding a new tool
To add a new tool:
- Copy the CLI Python tool template.
- Update the tool's name in all files.
- Implement
main.pyandlib.py. - Write the tests.
- Write the
README.md,TOOL.md,SKILL.md, andAGENTS.md. - Register the tool in the project's
tools.json. - Run the tests.
- Verify the tool can be invoked by the Coordinator.