What is Mira?
Mira is MentraOS’s AI assistant that lets users control your app using natural language. Instead of building UI buttons and menus, you expose functions that Mira automatically calls when users ask for something.The magic: User says “remind me to buy milk” → Mira calls your
add_todo function → Your app creates the todo → Mira confirms back to the user.Quick Start
1
Define your tool in the Developer Console
Go to console.mentra.glass/apps and add your tool with an ID, description, and parameters.
2
Implement the onToolCall method
Override
onToolCall in your AppServer to handle the tool logic.3
Test with Mira
Talk naturally to Mira and watch your tool get called automatically!
Example Code
Here’s how to handle a Mira tool call in your app:What's happening in this code?
What's happening in this code?
- Override the
onToolCallmethod in your AppServer class - Check
toolCall.toolIdto identify which function to run - Extract parameters from
toolCall.toolParameters - Execute your app logic
- Return a message (see “Understanding Tool Responses” below)
Understanding Tool Responses
Important: What you return fromonToolCall() determines how Mira responds to the user.
Default: Return Context for Mira
By default, your return string is context for Mira’s AI, not what the user sees directly:- Your app returns context about what happened
- Mira’s AI uses this to formulate a natural response
- User hears something like: “Got it, I’ve added that to your list” or “Done, that’s been saved”
- ✅ Natural, conversational responses
- ✅ Mira adapts the language to context
- ✅ Feels like talking to an assistant
Manual Control: Display Your Own UI
If you want precise control over what displays, returnGIVE_APP_CONTROL_OF_TOOL_RESPONSE:
- Your app displays custom UI (layouts, dashboard, etc.)
- Mira stays silent - doesn’t add any response
- User sees exactly what you designed
Return undefined
If you don’t handle a tool, returnundefined:
Quick Reference
| Return Value | Behavior | Use When |
|---|---|---|
String (e.g., "Task completed") | Mira uses as context to formulate natural response | Default - natural conversation |
GIVE_APP_CONTROL_OF_TOOL_RESPONSE | You display UI, Mira stays silent | Need custom formatting or precise control |
undefined | You don’t handle this tool | Tool not recognized |
Examples: Context vs Control
Let Mira Respond (Recommended)
Take Manual Control
Developer Console Setup
Define Your Tools
Configure your Mira tools in the Developer Console:
- Select your app
- Navigate to “AI Tools” section
- Add tools with IDs, descriptions, and parameters
- Mira will automatically start recognizing them
How Mira Works Behind the Scenes
1
User speaks to Mira
Example: “Hey Mira, remind me to buy milk tomorrow”
2
Mira analyzes the request
Mira’s AI identifies your
add_todo tool as the best match3
Mira extracts parameters
todo_item: "buy milk"due_date: "2025-11-04"
4
Mira calls your app
Sends a POST request to your
/tool endpoint (SDK handles this automatically)5
Your code executes
Your
onToolCall method runs the business logic6
You respond
Return a string like “Added: buy milk”
7
Mira responds to user
Mira formats your response into natural language and delivers it
Key insight: Tool calls work even when your app isn’t running. Mira can also chain multiple tools together to fulfill complex requests.
Tool Configuration
Tool Properties
id: Unique identifier (e.g.,"add_todo")description: What it does (helps Mira know when to call it)activationPhrases: Optional trigger phrasesparameters: What data you need
Parameter Properties
type:"string","number", or"boolean"description: What this parameter is forrequired: Is it mandatory?enum: Limit to specific values (optional)

