Skip to main content
Glama

pause

Pause playback on a specified or active Sonos device. Returns the device's state, including volume, track info, and playback status, for immediate confirmation.

Instructions

Pause playback on a Sonos device.

Args: name: The name of the device to pause. If None, uses the current device.

Returns: Dict[str, Any]: The device's state after pausing, including name, volume, state, and track info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo

Implementation Reference

  • The handler function for the 'pause' MCP tool. It is registered via the @mcp.tool() decorator. Retrieves the specified Sonos device, calls device.pause() to pause playback, and returns the updated device state using get_info_from.
    @mcp.tool()
    def pause(name: Optional[str] = None) -> Dict[str, Any]:
        """Pause playback on a Sonos device.
        
        Args:
            name: The name of the device to pause. If None, uses the current device.
            
        Returns:
            Dict[str, Any]: The device's state after pausing, including name, volume, state, and track info.
        """
        device = get_device(name)
        device.pause()
        return get_info_from(device)
  • Helper function used by the pause tool to fetch and format the device state after pausing.
    def get_info_from(device: soco.SoCo) -> Dict[str, Any]:
        """Retrieve detailed information from a Sonos device.
        
        Args:
            device: The Sonos device to retrieve information from.
            
        Returns:
            Dict[str, Any]: A dictionary containing the device's name, volume, state, and current track information.
        """
        track_info = device.get_current_track_info()
        return {
            "name": device.player_name,
            "volume": device.volume,
            "state": device.get_current_transport_info()["current_transport_state"],
            "track": {
                "title": track_info.get("title"),
                "artist": track_info.get("artist"),
                "album": track_info.get("album"),
                "position": track_info.get("position"),
                "duration": track_info.get("duration"),
                "playlist_position": track_info.get("playlist_position"),
                "album_art": track_info.get("album_art")
            }
        }
  • Helper function used by the pause tool to get the Sonos device instance by name or default.
    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")
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does (pauses playback) and describes the return format, which is helpful. However, it doesn't mention potential side effects, error conditions, authentication requirements, or rate limits that would be important for a media control tool.

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 well-structured with clear sections for the main description, arguments, and returns. It's appropriately sized with no wasted words. The only minor improvement would be integrating the parameter explanation more seamlessly rather than as a separate 'Args' section, but overall it's efficient.

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 (media control operation), no annotations, no output schema, and 1 parameter with 0% schema coverage, the description is adequate but has gaps. It explains the basic operation and return format but doesn't cover error handling, prerequisites, or how it differs from similar tools like 'stop'.

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 description adds meaningful context about the 'name' parameter that goes beyond the schema's 0% coverage. It explains that the parameter accepts a device name or None (defaulting to current device), which clarifies the optional nature and default behavior. This compensates well for the lack of schema descriptions.

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 'pause' and resource 'playback on a Sonos device', making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'stop' or distinguish between pausing vs stopping playback, which prevents 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 'stop' or 'play'. It mentions that if no device name is provided, it uses the current device, but this is parameter guidance rather than usage context. No explicit when/when-not scenarios or sibling tool comparisons are included.

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

  • @WinstonFassett/sonos-mcp-server
  • @WinstonFassett/sonos-mcp-server
  • @latiftplgu/Spotify-OAuth-MCP-server
  • @WinstonFassett/sonos-mcp-server
  • @WinstonFassett/sonos-mcp-server
  • @WinstonFassett/sonos-mcp-server

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