Skip to main content
Glama

speaker_info

Retrieve detailed speaker information for a specified or active Sonos device using the MCP Server, enabling precise control and management of your audio setup.

Instructions

Retrieve speaker information for a Sonos device.

Args: name: The name of the device to retrieve speaker information from. If None, uses the current device.

Returns: Dict[str, str]: A dictionary containing speaker information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo

Implementation Reference

  • The core handler function for the 'speaker_info' MCP tool, decorated with @mcp.tool() for registration. It uses the helper get_device to obtain the Sonos device and calls its get_speaker_info() method to return the speaker details as a dictionary.
    @mcp.tool()
    def speaker_info(name: Optional[str] = None) -> Dict[str, str]:
        """Retrieve speaker information for a Sonos device.
        
        Args:
            name: The name of the device to retrieve speaker information from. If None, uses the current device.
            
        Returns:
            Dict[str, str]: A dictionary containing speaker information.
        """
        return get_device(name).get_speaker_info()
  • Supporting helper function get_device that resolves the Sonos device by name (case-insensitive) or defaults to the first/current device, used by the speaker_info handler.
    def get_device(name: Optional[str] = None) -> soco.SoCo:
        """Retrieve a Sonos device by name or return the current device.
        
        Args:
            name: The name of the device to retrieve. If None, returns the current device.
            
        Returns:
            soco.SoCo: The Sonos device object.
            
        Raises:
            ValueError: If the specified device name is not found.
        """
        global device
        if not name and device:
            return device
        
        devices = get_devices()
        if not name:
            device = devices[list(devices.keys())[0]]
            return device
        
        if name in devices:
            device = devices[name]
            return device
        
        for key in devices:
            if key.lower() == name.lower():
                device = devices[key]
                return device
                
        raise ValueError(f"Device {name} not found")
  • server.py:264-264 (registration)
    The @mcp.tool() decorator registers the speaker_info function as an MCP tool.
    @mcp.tool()
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 it 'retrieves' information, implying a read-only operation, but doesn't disclose behavioral traits like whether it requires authentication, has rate limits, or what happens if the device name is invalid. This is a significant gap for a tool with no 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 appropriately sized and front-loaded, with the core purpose stated first, followed by clear sections for args and returns. Every sentence earns its place by providing essential information without redundancy.

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 moderate complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It covers the purpose and parameter semantics but lacks usage guidelines and behavioral transparency, making it adequate but not fully helpful for an AI agent.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that the 'name' parameter refers to the device name and defaults to the current device if None. However, it doesn't fully compensate for the coverage gap, as it doesn't specify format constraints or examples, keeping the baseline at 3.

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 'retrieve' and resource 'speaker information for a Sonos device', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_device_state' or 'get_all_device_states', which might also provide device-related information, so it doesn't reach the highest 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. It doesn't mention sibling tools or contexts where this specific speaker information retrieval is preferred over other device-related tools, leaving usage ambiguous.

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/WinstonFassett/sonos-mcp-server'

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