24 executable tools that agents can invoke: file I/O, git, web search, terminal,
Files
10
LOC
1,753
Key Concept
Every tool implements the Tool trait (name, description, params, execute). The registry makes them available to agents as function-calling definitions.
The Tool Trait
Every tool implements 4 things:
name() — unique identifier (e.g., "read_psi")
description() — what the tool does (shown to the LLM)
parameters() — list of inputs with types and descriptions
execute(args) — actually DO the thing, return success/failure + output
How Agents Use Tools
The orchestrator sends tool definitions to the LLM as JSON Schema
The LLM decides to call a tool → returns {"name": "read_psi", "arguments": {"target": "main.rs"}}
Mithril executes the tool via execute_tool_safe() (with panic protection)
The result is fed back to the LLM as a system message
The LLM can call more tools or respond to the user