Skip to main content
Glama

playCompletionSound

Plays a sound to provide audio feedback when Cursor AI completes code generation, enhancing interactivity during coding.

Instructions

Plays a completion sound when called

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic for the playCompletionSound tool. Plays the completion.mp3 sound file asynchronously using the play-sound library, with error handling and MCP response formatting.
    async () => {
      try {
        // Play custom sound using a Promise to handle the callback properly
        await new Promise<void>((resolve, reject) => {
          audioPlayer.play(COMPLETION_SOUND, (err: Error | null) => {
            if (err) {
              log(`Error playing sound: ${err.message}`);
              reject(err);
            } else {
              log('Played completion sound successfully');
              resolve();
            }
          });
        });
        
        // Return proper JSON response
        return {
          content: [{ type: 'text', text: 'Played completion sound' }]
        };
      } catch (error) {
        log(`Failed to play sound: ${error}`);
        return {
          content: [{ type: 'text', text: 'Failed to play sound' }]
        };
      }
    }
  • src/index.ts:27-56 (registration)
    Registers the playCompletionSound tool with the MCP server, providing the tool name, description, and inline handler function.
    server.tool(
      'playCompletionSound',
      'Plays a completion sound when called',
      async () => {
        try {
          // Play custom sound using a Promise to handle the callback properly
          await new Promise<void>((resolve, reject) => {
            audioPlayer.play(COMPLETION_SOUND, (err: Error | null) => {
              if (err) {
                log(`Error playing sound: ${err.message}`);
                reject(err);
              } else {
                log('Played completion sound successfully');
                resolve();
              }
            });
          });
          
          // Return proper JSON response
          return {
            content: [{ type: 'text', text: 'Played completion sound' }]
          };
        } catch (error) {
          log(`Failed to play sound: ${error}`);
          return {
            content: [{ type: 'text', text: 'Failed to play sound' }]
          };
        }
      }
    );
  • Initializes the audio player instance and defines the path to the completion sound file used by the handler.
    const audioPlayer = player();
    // Use the custom sound file from the sounds directory
    const COMPLETION_SOUND = path.join(__dirname, '..', 'sounds', 'completion.mp3');
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 states the tool plays a sound, implying an auditory output, but doesn't disclose behavioral traits like whether it requires audio permissions, if it blocks execution, error handling, or what happens on failure. This is a significant gap for a tool with zero annotation coverage.

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 a single, efficient sentence with no wasted words. It's appropriately sized for a simple tool and front-loaded with the core action. Every word earns its place, making it highly concise and well-structured.

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 the tool's simplicity (0 parameters, no output schema), the description is incomplete. It lacks context about the sound's source, volume, duration, or system requirements. With no annotations to fill gaps, the description should provide more detail to ensure the agent understands how to invoke it effectively.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (as there are no parameters to describe). The description doesn't need to add parameter semantics, so a baseline score of 4 is appropriate, reflecting that no additional information is required beyond the empty schema.

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

Purpose3/5

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

The description states the tool's purpose ('Plays a completion sound when called'), which is clear but vague. It specifies the action ('Plays') and resource ('a completion sound'), but lacks detail about what constitutes a 'completion sound' or how it's played. With no sibling tools, differentiation isn't needed, but the purpose remains somewhat ambiguous.

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 no guidance on when to use this tool. It doesn't specify appropriate contexts (e.g., after a task finishes), prerequisites, or alternatives. With no sibling tools, this isn't a comparative issue, but the lack of any usage context leaves the agent without direction.

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

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

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