Skip to main content
Learn how to build a simple but practical app that lets users save a quick note to their dashboard using voice commands. This cookbook demonstrates three core MentraOS features working together.

What You’ll Build

A voice-controlled note app where users can:
  • Say “Save a note saying pick up milk” → Note appears on dashboard
  • Say “What’s my note?” → Mira reads it back
  • Say “Clear my note” → Note is removed
The note displays in the bottom-right of the dashboard (visible when user looks up) and persists across app sessions.

Features Demonstrated

Mira Tool Calls

Voice commands that trigger functions

Simple Storage

Persist data across sessions

Dashboard API

Display persistent UI

Prerequisites


Step 1: Define Tools in Developer Console

First, create three tools in the Developer Console for your app:

Tool 1: Save Note

Good tool description: Notice how the description tells Mira when to use this tool (“when the user wants to remember something quickly”) and what it does (“visible when they look up”). This helps Mira understand context.

Tool 2: Read Note

Tool 3: Clear Note

These tool definitions are configured in the Developer Console, not in your code. Mira uses these descriptions to decide when to call each tool.

Step 2: Create the App Server

Create a new file src/index.ts:

Step 3: Understanding the Code

Session Management

What’s happening:
  1. User opens your app on glasses
  2. App loads saved note from Simple Storage
  3. If note exists, display it on dashboard immediately
  4. User sees their note when they look up

Tool Call Handling

What’s happening:
  1. User says something like “Save a note saying pick up milk”
  2. Mira recognizes this matches the save_note tool
  3. Mira extracts parameters: { note: "pick up milk" }
  4. Your onToolCall is triggered with the tool ID and parameters
  5. You handle the logic (save to storage, update dashboard)
  6. You return context for Mira to formulate a response

Tool Response: Context vs Control

By default (what we’re using):
This is context for Mira, not what the user sees/hears. Mira uses this to formulate a natural response like:
  • “Got it, I’ve saved that note for you”
  • “Your note has been added to the dashboard”
  • “Done, I’ve saved that”
Taking control of the response:
This tells Mira “I’ve handled the response myself, don’t say anything.”
Let Mira respond (default - recommended):
  • Natural, conversational responses
  • User expects voice assistant behavior
  • Simple confirmations
Take control:
  • Need specific formatting
  • Want to show custom UI
  • Need to display data that doesn’t translate well to speech
  • Want precise control over wording

Step 4: Simple Storage API

Simple Storage provides localStorage-like API with cloud sync:
Key features:
  • Per-user isolation - Each user has their own storage
  • Cloud sync - Data persists across devices and sessions
  • Local caching - Fast reads after initial fetch
  • String values - Store strings (use JSON.stringify/parse for objects)

Step 5: Dashboard API

The dashboard displays persistent UI in the bottom-right when user looks up:
Best practices:
  • Keep text short (dashboard space is limited)
  • Use for glanceable information
  • Update when data changes
  • Clear when no longer relevant
Dashboard updates are automatically throttled to 1 per 300ms by MentraOS Cloud to prevent display desync.

Step 6: Testing

Local Testing

  1. Start your app:
  2. Create ngrok tunnel:
  3. Update Developer Console:
  4. Test on glasses:
    • Open your app on MentraOS glasses
    • Say: “Save a note saying test message”
    • Look up → You should see “test message” on dashboard
    • Say: “What’s my note?”
    • Say: “Clear my note”

What to Expect

When saving:
  • User: “Save a note saying pick up milk”
  • Mira: “Got it, I’ve saved that note”
  • Dashboard displays: “pick up milk”
When reading:
  • User: “What’s my note?”
  • Mira: “Your note says: pick up milk”
When clearing:
  • User: “Clear my note”
  • Mira: “Your note has been cleared”
  • Dashboard becomes empty

Common Issues

Tool Not Being Called

Problem: Mira doesn’t recognize your voice command Solution: Improve tool descriptions

Note Not Persisting

Problem: Note disappears when app restarts Solution: Make sure you’re loading the note in onSession:

Dashboard Not Updating

Problem: Dashboard shows old/wrong content Solution: Always update dashboard after storage changes:

Extending This Example

Add Note Categories

Add Timestamps

Add Note History


Key Takeaways

Tool descriptions matter - They help Mira understand when to call your tools
Simple Storage persists data - Perfect for user preferences and quick data
Dashboard is glanceable - Great for persistent, at-a-glance information
Tool responses are context - Mira uses them to formulate natural responses
Load data in onSession - Always restore saved data when user opens app

Next Steps

AI Tool Calls

Learn more about tool calls (under maintenance, returning later in 2026)

Simple Storage

Complete storage API reference

Dashboard API

Dashboard display guide

Deployment

Deploy your app

Discord Community

Get help and share