Tool System
Tools in MIRA are self-contained capabilities that load on demand. They're designed to be token-efficient, expiring when unused, and easy to extend.
Design Philosophy
Each tool is entirely self-contained: configuration, schema, and implementation live in one file. No separate config needed. Drop the file in the right folder, restart the process, and the tool auto-registers on startup.
Dynamic Loading
Only three essential tools stay permanently loaded:
web_toolinvokeother_toolgetcontext_tool
All other tools exist as one-line hints in working memory (tool name plus a simple description). When MIRA needs a capability, it calls invokeother_tool to load the full definition on demand.
Token Efficiency
With roughly 15 available tools at 150-400 tokens each, that's 2,250-6,000 tokens not wasted per turn when tools aren't needed.
Loaded tools auto-unload after 5 turns unused (configurable via idle_threshold). There's also a fallback mode that loads everything for one turn if MIRA gets stuck.
Available Tools
| Tool | Purpose |
|---|---|
| Contacts | Manage contact information |
| Maps | Location and navigation queries |
| Send and manage email | |
| Weather | Weather forecasts and conditions |
| Pager | Send notifications/alerts |
| Reminder | Schedule reminders |
| Web Search | Search the web |
| History Search | Search conversation history |
| Domaindoc | Edit domaindocs |
| SpeculativeResearch | Background research tasks |
| InvokeOther | Load other tools on demand |
Extensibility
Adding a new tool is straightforward:
- Give Claude Code (or your editor) context about what you want
- Drop the new tool file in
tools/implementations/ - Restart the MIRA process
- The tool auto-registers on startup
There's a HOW_TO_BUILD_A_TOOL.md guide in the repo written specifically to give an LLM the context needed to zero-shot a working tool.
Tool Data Storage
Tools can store their own data using the self.user_data_path property, which provides a user-specific directory. For simple data, use JSON. For complex data, SQLite. Or use self.db for the main database.
User isolation is handled at the architecture level, not in individual tool code.