Skip to main content
Glama

play_error_sound

Play a system error sound to provide audio feedback for error conditions in macOS applications.

Instructions

Play an error system sound

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the play_error_sound tool by calling the shared playSound helper with 'error' type and returns a success response.
    case 'play_error_sound':
      await playSound('error');
      return {
        content: [
          {
            type: 'text',
            text: 'Error sound played successfully',
          },
        ],
      };
  • src/index.ts:297-305 (registration)
    Registers the play_error_sound tool in the ListTools response with description and empty input schema.
    {
      name: 'play_error_sound',
      description: 'Play an error system sound',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • Input schema for play_error_sound: empty object (no parameters required).
    inputSchema: {
      type: 'object',
      properties: {},
      required: [],
    },
  • Helper function playSound that implements the core logic: maps 'error' to 'Sosumi' system sound and spawns afplay process with throttling and timeout.
    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);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Play') but doesn't describe what 'Play' entails (e.g., audio output, duration, system requirements) or any side effects (e.g., interruptions, permissions needed). This leaves significant gaps in understanding the tool's behavior.

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 that directly states the tool's purpose without any wasted words. It's front-loaded and appropriately sized for a simple tool, making it easy for an agent to parse quickly.

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

Completeness3/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, no annotations), the description is minimally adequate. It states what the tool does but lacks details on behavioral context (e.g., how the sound is played, any system dependencies). For such a straightforward tool, this is acceptable but not comprehensive.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't mention parameters, which is correct for a parameterless tool, earning a high baseline score for not adding unnecessary information.

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 ('Play') and resource ('error system sound'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'play_warning_sound' or 'play_info_sound' beyond the 'error' qualifier, which is why it doesn't reach a perfect score.

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 versus alternatives like 'play_warning_sound' or 'play_sound'. It lacks explicit context, exclusions, or comparisons to sibling tools, leaving the agent to infer usage based on the 'error' keyword alone.

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

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