Skip to main content
Glama

play_info_sound

Play a macOS system sound to provide audio feedback for informational events, helping users receive audible notifications during AI assistant interactions.

Instructions

Play an informational system sound

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic for the 'play_info_sound' tool. Calls playSound('info') to play the system 'Glass' sound and returns a success response.
    case 'play_info_sound': await playSound('info'); return { content: [ { type: 'text', text: 'Info sound played successfully', }, ], };
  • Input schema for 'play_info_sound' tool, which requires no parameters.
    inputSchema: { type: 'object', properties: {}, required: [], },
  • src/index.ts:279-287 (registration)
    Registration of the 'play_info_sound' tool in the ListTools response, including name, description, and schema.
    { name: 'play_info_sound', description: 'Play an informational system sound', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • Helper function playSound that implements the core logic for playing info/warning/error system sounds using afplay on macOS system sound files. Maps 'info' to 'Glass.aiff'.
    async function playSound(soundType: 'info' | 'warning' | 'error'): Promise<void> { const requestId = `${soundType}-${Date.now()}`; // Throttle requests to prevent conflicts if (activeRequests.has(soundType)) { throw new Error(`${soundType} sound already playing`); } activeRequests.add(soundType); try { return new Promise((resolve, reject) => { let soundName: string; switch (soundType) { case 'info': soundName = 'Glass'; break; case 'warning': soundName = 'Purr'; break; case 'error': soundName = 'Sosumi'; break; default: soundName = 'Glass'; } const afplay = spawn('afplay', [`/System/Library/Sounds/${soundName}.aiff`]); // Add timeout const timeout = setTimeout(() => { afplay.kill(); reject(new Error('Sound playback timed out')); }, PROCESS_TIMEOUT_MS); afplay.once('close', (code) => { clearTimeout(timeout); if (code === 0) { resolve(); } else { reject(new Error(`Sound playback failed with code ${code}`)); } }); afplay.once('error', (error) => { clearTimeout(timeout); reject(error); }); }); } finally { activeRequests.delete(soundType); } }

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/nocoo/mcp-make-sound'

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