Skip to main content
Glama

player_status

Get current mpv playback details: file name, position, duration, volume, speed, and pause state. Enables AI to answer questions about what's playing and its progress.

Instructions

Get current playback status: file name, position, duration, volume, speed, pause state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.js:408-413 (registration)
    Tool registration for 'player_status' in the TOOLS array. Defines the tool name, description, and empty input schema (no parameters required).
    {
      name: "player_status",
      description:
        "Get current playback status: file name, position, duration, volume, speed, pause state.",
      inputSchema: { type: "object", properties: {} },
    },
  • Handler implementation for 'player_status'. Checks if mpv is running, then queries mpv IPC for media-title, time-pos, duration, pause, volume, speed, playlist-pos, and playlist-count. Formats all data into a human-readable status message.
    case "player_status": {
      const running = await isMpvRunning();
      if (!running) return info("mpv is not running.");
    
      const [filename, pos, dur, paused, vol, speed, plPos, plCount] =
        await Promise.all([
          getProperty("media-title").catch(() => null),
          getProperty("time-pos").catch(() => null),
          getProperty("duration").catch(() => null),
          getProperty("pause").catch(() => null),
          getProperty("volume").catch(() => null),
          getProperty("speed").catch(() => null),
          getProperty("playlist-pos").catch(() => null),
          getProperty("playlist-count").catch(() => null),
        ]);
    
      const lines = [
        `🎵 **Now playing:** ${filename || "N/A"}`,
        `⏱  **Position:** ${formatTime(pos)} / ${formatTime(dur)}`,
        `${paused ? "⏸" : "▶️"}  **State:** ${paused ? "Paused" : "Playing"}`,
        `🔊 **Volume:** ${vol != null ? Math.round(vol) : "N/A"}`,
        `⚡ **Speed:** ${speed != null ? speed + "x" : "N/A"}`,
        `📋 **Playlist:** ${plPos != null ? plPos + 1 : "N/A"} / ${plCount ?? "N/A"}`,
      ];
      return info(lines.join("\n"));
    }
  • Helper used in the player_status handler to check if mpv process is currently running by attempting a TCP connection to the IPC pipe.
    function isMpvRunning() {
      return new Promise((resolve) => {
        const client = net.createConnection(PIPE_PATH);
        client.on("connect", () => { client.destroy(); resolve(true); });
        client.on("error", () => resolve(false));
      });
    }
  • Helper used in the player_status handler to format time values (position and duration) into human-readable HH:MM:SS or MM:SS format.
    function formatTime(secs) {
      if (secs == null) return "N/A";
      const h = Math.floor(secs / 3600);
      const m = Math.floor((secs % 3600) / 60);
      const s = Math.floor(secs % 60);
      return h > 0
        ? `${h}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`
        : `${m}:${String(s).padStart(2, "0")}`;
    }
  • Helper used in the player_status handler to wrap the status message into an MCP response with text content.
    function info(msg) {
      return { content: [{ type: "text", text: msg }] };
    }
Behavior4/5

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

With no annotations provided, the description adequately conveys that this tool is a read-only operation returning specific playback details. It does not mention side effects or additional behavioral traits, but for a status query, the description is transparent enough.

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 a single sentence that directly states the purpose and lists the key return values. No wasted words, and the most important information is front-loaded.

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?

For a tool with no parameters and no output schema, the description fully covers what the tool does and what information it returns. It is complete and sufficient for an agent to use.

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 input schema has zero parameters, and the description does not need to add parameter details. According to guidelines, 0 params baseline is 4. The description adds meaning by listing the return fields.

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 'Get current playback status' and enumerates the specific fields returned (file name, position, duration, volume, speed, pause state). This distinguishes it from sibling tools which are all control actions (play, pause, next, etc.).

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 implies usage context: use this to retrieve current playback state. It does not explicitly state when not to use it, but given the tool's simplicity and differentiation from sibling tools, the guidance is sufficient.

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/guodaxia9527/mcp-mpv-player'

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