Skip to main content
Glama
PetitBaguette

play-sound-mcp-server

play-local-sound

Play local sound files on macOS using afplay to trigger audio notifications after AI assistant responses.

Instructions

ローカルのサウンドファイル(sound.mp3)をafplayで再生します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'play-local-sound' tool. It uses child_process.exec to run 'afplay' on the local sound file and resolves with a success or error message.
    async () => {
      return new Promise((resolve) => {
        exec(`afplay "${soundFile}"`, (error) => {
          if (error) {
            resolve({
              content: [
                { type: "text", text: `サウンド再生に失敗しました: ${error}` },
              ],
            });
          } else {
            resolve({
              content: [
                { type: "text", text: `サウンド(${soundFileName})を再生しました。` },
              ],
            });
          }
        });
      });
    }
  • src/index.ts:23-46 (registration)
    Registration of the 'play-local-sound' tool using server.tool(name, description, schema, handler).
    server.tool(
      "play-local-sound",
      `ローカルのサウンドファイル(${soundFileName})をafplayで再生します。`,
      {},
      async () => {
        return new Promise((resolve) => {
          exec(`afplay "${soundFile}"`, (error) => {
            if (error) {
              resolve({
                content: [
                  { type: "text", text: `サウンド再生に失敗しました: ${error}` },
                ],
              });
            } else {
              resolve({
                content: [
                  { type: "text", text: `サウンド(${soundFileName})を再生しました。` },
                ],
              });
            }
          });
        });
      }
    );
  • Empty input schema object for the 'play-local-sound' tool.
    {},
  • Helper code to compute the absolute path to the sound file based on command-line argument or default.
    // サウンドファイルの絶対パスを取得
    const __dirname = path.dirname(fileURLToPath(import.meta.url));
    // コマンドライン引数からファイル名を取得(デフォルト: sound.mp3)
    const soundFileName = process.argv[2] || "sound.mp3";
    const soundFile = path.join(__dirname, "..", "sounds", soundFileName);
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 playback but lacks details on behavioral traits like error handling (e.g., if file is missing), system requirements, or side effects (e.g., audio interruption). It's minimal and doesn't disclose key operational aspects.

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

Conciseness4/5

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

The description is a single, efficient sentence in Japanese that directly states the tool's function without unnecessary details. It's front-loaded and appropriately sized for a simple tool, though minor improvements in clarity (e.g., language consistency) could enhance it.

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 adequate but minimal. It covers the basic purpose but lacks completeness in usage guidelines and behavioral transparency, which are important even for simple tools to ensure reliable operation.

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 discuss parameters, earning a baseline high score as it doesn't need to compensate for gaps.

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 action ('play') and resource ('local sound file sound.mp3'), specifying it uses 'afplay' for playback. It's specific about the exact file name and playback method, though there are no sibling tools to distinguish from.

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?

No guidance is provided on when to use this tool versus alternatives, prerequisites (e.g., file existence, system compatibility), or limitations. The description only states what it does without context for application.

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/PetitBaguette/play-sound-mcp-server'

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