Skip to main content
Glama

mode

Control or retrieve the play mode of a Sonos device, such as 'NORMAL', 'SHUFFLE_NOREPEAT', 'SHUFFLE', or 'REPEAT_ALL', by specifying the mode and device name.

Instructions

Get or set the play mode of a Sonos device.

Args: mode: The play mode to set (e.g., "NORMAL", "SHUFFLE_NOREPEAT", "SHUFFLE", "REPEAT_ALL"). If None, returns the current mode. name: The name of the device to set the mode for. If None, uses the current device.

Returns: str: The current play mode after the operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo
nameNo

Implementation Reference

  • The handler function for the 'mode' MCP tool, decorated with @mcp.tool() for registration. It gets or sets the play mode (NORMAL, SHUFFLE_NOREPEAT, SHUFFLE, REPEAT_ALL) on a Sonos device, using type hints and docstring for schema.
    @mcp.tool()
    def mode(
        mode: Optional[Literal["NORMAL", "SHUFFLE_NOREPEAT", "SHUFFLE", "REPEAT_ALL"]] = None, 
        name: Optional[str] = None
    ) -> str:
        """Get or set the play mode of a Sonos device.
        
        Args:
            mode: The play mode to set (e.g., "NORMAL", "SHUFFLE_NOREPEAT", "SHUFFLE", "REPEAT_ALL"). If None, returns the current mode.
            name: The name of the device to set the mode for. If None, uses the current device.
            
        Returns:
            str: The current play mode after the operation.
        """
        device = get_device(name)
        if mode:
            device.play_mode = mode
        return device.play_mode
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. It discloses that the tool can both get and set modes, and specifies the return value. However, it misses behavioral details like whether setting a mode requires specific permissions, if changes are immediate, or potential side effects (e.g., affecting other devices).

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 appropriately sized and front-loaded with the core purpose. The Args and Returns sections are structured for clarity, though some sentences could be more concise (e.g., combining explanations of None behavior). Overall, it avoids unnecessary verbosity.

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 no annotations, 0% schema coverage, and no output schema, the description is moderately complete. It covers purpose, parameters, and return value, but lacks context on error handling, device selection defaults, or integration with sibling tools (e.g., how mode interacts with 'play' or 'pause').

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?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining the semantics of 'mode' (e.g., example values like 'NORMAL') and 'name' (device targeting), including conditional behaviors ('If None, returns...'). This clarifies beyond the schema's basic types and enums.

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 verb ('Get or set') and resource ('play mode of a Sonos device'), making the purpose specific. It distinguishes from siblings like 'play', 'pause', or 'volume' by focusing on playback modes rather than playback control or volume adjustment.

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

Usage Guidelines3/5

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

The description implies usage through the conditional logic in the Args section (e.g., 'If None, returns the current mode'), suggesting when to use it for getting vs. setting. However, it lacks explicit guidance on when to choose this tool over alternatives like 'play' or 'pause', or any prerequisites.

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
  • @WinstonFassett/sonos-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