Skip to main content
Glama

skip

Skip tracks in the queue for a Sonos device by specifying the number of tracks to advance and the device name. Returns the updated device state, including track, volume, and playback details.

Instructions

Skip tracks in the queue for a Sonos device.

Args: increment: The number of tracks to skip forward. Defaults to 1. name: The name of the device to skip tracks on. If None, uses the current device.

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

Raises: ValueError: If the new track position is out of the queue's range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
incrementNo
nameNo

Implementation Reference

  • The handler function for the 'skip' tool, decorated with @mcp.tool() for registration. It skips a specified number of tracks in the Sonos queue by calculating the new index and calling play_from_queue.
    @mcp.tool()
    def skip(increment: int = 1, name: Optional[str] = None) -> Dict[str, Any]:
        """Skip tracks in the queue for a Sonos device.
        
        Args:
            increment: The number of tracks to skip forward. Defaults to 1.
            name: The name of the device to skip tracks on. If None, uses the current device.
            
        Returns:
            Dict[str, Any]: The device's state after skipping tracks, including name, volume, state, and track info.
            
        Raises:
            ValueError: If the new track position is out of the queue's range.
        """
        sonos = get_device(name)
        current = int(sonos.get_current_track_info()['playlist_position'])
        new_index = current + increment
        queue_length = sonos.queue_size
        
        if not 0 <= new_index < queue_length:
            raise ValueError(f"Cannot skip to position {new_index}")
        
        sonos.play_from_queue(new_index)
        return get_info_from(sonos)
  • Input schema defined by function parameters (increment: int default 1, name: Optional[str]) and output type Dict[str, Any]. Docstring provides detailed description for MCP tool schema.
    def skip(increment: int = 1, name: Optional[str] = None) -> Dict[str, Any]:
        """Skip tracks in the queue for a Sonos device.
        
        Args:
            increment: The number of tracks to skip forward. Defaults to 1.
            name: The name of the device to skip tracks on. If None, uses the current device.
            
        Returns:
            Dict[str, Any]: The device's state after skipping tracks, including name, volume, state, and track info.
  • server.py:317-317 (registration)
    The @mcp.tool() decorator registers the skip function as an MCP tool.
    @mcp.tool()
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 successfully describes the core operation (skipping tracks) and mentions error conditions (ValueError for out-of-range positions), but doesn't cover important behavioral aspects like whether this requires specific permissions, what happens if the device is offline, or rate limits. The return format is described but not comprehensively.

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 (Args, Returns, Raises) and front-loaded purpose statement. Every sentence earns its place by providing essential information. It could be slightly more concise by integrating the purpose statement with parameter explanations, but overall it's efficient and organized.

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

Completeness4/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 (queue manipulation with error conditions), no annotations, and no output schema, the description does a good job covering the essentials: purpose, parameters, return format, and error cases. It could be more complete by explaining what happens when skipping backward (negative increments) or clarifying the relationship with 'next'/'previous' tools, but it provides sufficient context for basic use.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed semantic information for both parameters. It explains that 'increment' controls how many tracks to skip forward with a default value, and 'name' identifies the target device with a fallback to current device. This adds substantial value beyond the bare schema.

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 specific action ('skip tracks in the queue') and the target resource ('for a Sonos device'), distinguishing it from siblings like 'next', 'previous', 'play', or 'pause' which have different queue manipulation functions. The verb+resource combination is precise and unambiguous.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool (to skip tracks in a queue) and implicitly distinguishes it from 'next' (which likely skips forward one track) by allowing variable increments. However, it doesn't explicitly state when NOT to use it or name specific alternatives like 'next' or 'previous' for comparison.

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