Skip to main content
Glama
tijs

MCP Sound Tool

by tijs

list_available_sounds

Discover all available notification sounds for audio feedback. Check which sound options exist before selecting a custom sound.

Instructions

    List all available notification sounds.
    
    WHEN TO USE THIS TOOL:
    - When you need to check what sound options are available
    - When determining if a specific sound file exists
    - Before using a custom sound to verify available options
    
    This tool helps you discover what sounds are available for providing audio feedback.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual handler function for the 'list_available_sounds' tool. It lists .mp3 and .wav files from self.sounds_dir using os.listdir and returns them as a formatted string.
    def list_available_sounds() -> str:
        try:
            sounds = [f for f in os.listdir(self.sounds_dir) if f.endswith(('.mp3', '.wav'))]
            if sounds:
                return "Available sounds:\n" + "\n".join(sounds)
            else:
                return "No sound files found in the sounds directory."
        except Exception as e:
            return f"Error listing sounds: {e}"
  • The schema/tool definition for 'list_available_sounds'. Defines name, description, parameters (empty object), and return type.
    list_sounds_tool_definition = {
        "name": "list_available_sounds",
        "description": """
        List all available notification sounds.
        
        Use this tool when you need to check what sound options are available to play.
        This is helpful when determining what custom sounds might be available.
        """,
        "parameters": {
            "type": "object",
            "properties": {},
            "required": []
        },
        "returns": {
            "type": "string",
            "description": "A string listing all available sound files"
        }
    }
  • The tool is registered via the @self.mcp.tool() decorator inside SoundToolServer.register_tools() method (line 118). The decorator wraps list_available_sounds with description metadata.
    @self.mcp.tool(description="""
    List all available notification sounds.
    
    WHEN TO USE THIS TOOL:
    - When you need to check what sound options are available
    - When determining if a specific sound file exists
    - Before using a custom sound to verify available options
    
    This tool helps you discover what sounds are available for providing audio feedback.
    """)
    def list_available_sounds() -> str:
        try:
            sounds = [f for f in os.listdir(self.sounds_dir) if f.endswith(('.mp3', '.wav'))]
            if sounds:
                return "Available sounds:\n" + "\n".join(sounds)
            else:
                return "No sound files found in the sounds directory."
        except Exception as e:
            return f"Error listing sounds: {e}"
  • The __init__ method of SoundToolServer also calls register_tools() which registers list_available_sounds. The sounds_dir attribute used by the handler is initialized earlier in __init__ (lines 52-76).
    # Log available sounds for reference
    try:
        sounds = [f for f in os.listdir(self.sounds_dir) if f.endswith(('.mp3', '.wav'))]
        print(f"Available sounds: {', '.join(sounds)}")
    except Exception:
        pass
        
    # Register tools
    self.register_tools()
Behavior3/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. It implies read-only fetching of available sounds, but does not explicitly state that it is safe, nondestructive, or what the output format is. Since it's a simple list tool, this is adequate but not fully transparent.

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 extremely concise with only two sentences plus a bulleted usage section. It front-loads the purpose and uses clear formatting, making it easy to parse.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool complexity (no parameters), the presence of an output schema, and the absence of annotations, the description fully covers the tool's purpose and usage. No additional details are needed.

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 no parameters, and schema coverage is 100%. The description adds value by explaining the purpose, aligning with the baseline score of 4 for parameterless tools.

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

Purpose5/5

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

The description clearly states the tool lists all available notification sounds. It uses specific verb 'list' and resource 'notification sounds', distinguishing it from sibling tools like 'play_sound' and 'install_to_user_dir'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides three scenarios for when to use the tool: checking available options, verifying existence of a specific sound, and before using a custom sound. This gives clear guidance without needing to mention alternatives.

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

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