Skip to main content
Glama

notify

Send audio notifications on macOS to alert users with spoken messages for questions, alerts, confirmations, or information updates.

Instructions

Provide audio notifications to users (macOS only)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe message to speak
typeNoType of notificationinfo
voiceNoVoice to use for speech (e.g., "Daniel", "Samantha")
rateNoSpeaking rate in words per minute

Implementation Reference

  • Core handler function executing the notification logic: platform-specific handling, pauses/resumes Spotify, and runs the TTS command.
    async execute(args: NotificationOptions): Promise<CallToolResult> {
      // For non-macOS platforms, handle differently
      if (platform() !== 'darwin') {
        const { message, type = 'info' } = args;
        console.log(`[${type.toUpperCase()}] ${message}`);
        return createSuccessResult('Notification displayed in console (audio not available on this platform)');
      }
      
      // Check if Spotify is playing and pause it
      const wasPlaying = await isSpotifyPlaying();
      if (wasPlaying) {
        await pauseSpotify();
      }
      
      // Execute the notification
      const result = await super.execute(args);
      
      // Resume Spotify if it was playing
      if (wasPlaying) {
        // Add a small delay to ensure the notification finishes speaking
        await new Promise(resolve => setTimeout(resolve, 1500));
        await resumeSpotify();
      }
      
      return result;
    }
  • Builds the shell command for macOS 'say' TTS based on notification options including voice, rate, and type-specific prefixes.
    protected buildCommand(args: NotificationOptions): string {
      const { message, type = 'info', voice, rate } = args;
      
      // Only support macOS say command for now
      if (platform() !== 'darwin') {
        // For non-macOS, we'll just log to console and return empty command
        console.log(`[${type.toUpperCase()}] ${message}`);
        return 'echo "Notification sent to console"';
      }
      
      // Build the say command with options
      const parts = ['say'];
      
      // Add voice option if specified
      if (voice) {
        parts.push('-v', voice);
      }
      
      // Add rate option if specified (words per minute)
      if (rate) {
        parts.push('-r', rate.toString());
      }
      
      // Add prefix based on notification type
      let prefix = '';
      switch (type) {
        case 'question':
          prefix = 'Question: ';
          break;
        case 'alert':
          prefix = 'Alert! ';
          break;
        case 'confirmation':
          prefix = 'Please confirm: ';
          break;
        case 'info':
        default:
          prefix = '';
      }
      
      // Add the message with proper escaping
      const fullMessage = prefix + message;
      parts.push(`"${fullMessage.replace(/"/g, '\\"')}"`);
      
      return parts.join(' ');
    }
  • src/index.ts:95-108 (registration)
    Registers the 'notify' tool with the MCP server, including Zod input schema and handler reference.
    // Register notify tool
    server.registerTool(
      'notify',
      {
        description: 'Provide audio notifications to users (macOS only)',
        inputSchema: {
          message: z.string().describe('The message to speak'),
          type: z.enum(['question', 'alert', 'confirmation', 'info']).optional().default('info').describe('Type of notification'),
          voice: z.string().optional().describe('Voice to use for speech (e.g., "Daniel", "Samantha")'),
          rate: z.number().optional().describe('Speaking rate in words per minute'),
        },
      },
      async (args) => notify(args)
    );
  • TypeScript interface defining the input shape for notify tool parameters.
    export interface NotificationOptions {
      message: string;
      type?: 'question' | 'alert' | 'confirmation' | 'info';
      voice?: string;
      rate?: number;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'audio notifications' and 'macOS only', but fails to disclose key behavioral traits such as whether it's read-only or destructive, authentication needs, rate limits, or error handling. The description is too vague to inform the agent adequately about how the tool behaves beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence, front-loaded with the core purpose and key constraint ('macOS only'). Every word earns its place, with no redundancy or unnecessary details, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits, return values, error cases, and usage context. For a tool with 4 parameters and platform-specific constraints, more detail is needed to ensure the agent can use it correctly without relying on external knowledge.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond what the schema provides, such as examples or context for parameter use. Baseline score of 3 is appropriate as the schema handles parameter documentation, but the description doesn't compensate or enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Provide audio notifications') and resource ('to users'), specifying the action and target. It distinguishes from siblings by mentioning 'audio notifications' and 'macOS only', though it doesn't explicitly differentiate from similar notification tools that might exist elsewhere. The purpose is specific but could be more distinct regarding sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance with 'macOS only', indicating a platform restriction. However, it lacks explicit when-to-use instructions, alternatives, or context for choosing this tool over others. No mention of prerequisites, timing, or comparison with sibling tools like 'music' or 'review_code' is made, leaving usage unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jaggederest/mcp_reviewer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server