Skip to main content
Glama

playCompletionSound

Play a sound effect when Cursor AI finishes code generation to provide immediate audio feedback, enhancing interactivity during coding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'playCompletionSound' tool that plays a macOS system completion sound using the 'play-sound' library and returns a textual response indicating success or failure.
    async () => { try { // Play macOS system sound audioPlayer.play(SYSTEM_SOUND, (err: Error | null) => { if (err) console.error('Error playing sound:', err); }); return { content: [{ type: 'text', text: 'Played completion sound' }] }; } catch (error) { console.error('Failed to play sound:', error); return { content: [{ type: 'text', text: 'Failed to play sound' }] }; } }
  • src/index.ts:15-34 (registration)
    Registers the 'playCompletionSound' tool with the MCP server, providing an empty input schema and the inline handler function.
    server.tool( 'playCompletionSound', {}, async () => { try { // Play macOS system sound audioPlayer.play(SYSTEM_SOUND, (err: Error | null) => { if (err) console.error('Error playing sound:', err); }); return { content: [{ type: 'text', text: 'Played completion sound' }] }; } catch (error) { console.error('Failed to play sound:', error); return { content: [{ type: 'text', text: 'Failed to play sound' }] }; } } );
  • Imports the 'play-sound' module, initializes the audio player instance, and defines the path to the macOS system sound file used by the handler.
    import player from 'play-sound'; const audioPlayer = player(); const SYSTEM_SOUND = '/System/Library/Sounds/Glass.aiff'; // macOS system sound

Other Tools

Related 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/ericlistin/sound-mcp'

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