Skip to main content
Glama

player_stop

Stop mpv playback and clear the currently loaded media file, allowing a fresh start for the next selection.

Instructions

Stop playback and clear the current file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool schema definition for player_stop — defines the tool name, description, and empty input schema (no parameters needed).
      name: "player_stop",
      description: "Stop playback and clear the current file.",
      inputSchema: { type: "object", properties: {} },
    },
  • Handler implementation for player_stop — ensures mpv is running, sends the 'stop' command via IPC, and returns a success message.
    case "player_stop": {
      await ensureMpv();
      await mpv("stop");
      return ok("Stopped");
    }
  • index.js:726-728 (registration)
    MCP server registration — the CallToolRequestSchema handler dispatches tool calls (including 'player_stop') to the handleTool function.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      return handleTool(name, args || {});
  • Helper function that sends IPC commands to mpv via named pipe. Used by the handler to issue the 'stop' command.
    async function mpv(command, args = []) {
      return ipcCommand({ command: [command, ...args], request_id: reqId++ });
    }
  • Helper that ensures the mpv process is running before executing player commands.
    async function ensureMpv(filePath = null) {
      const running = await isMpvRunning();
      if (running) return { started: false };
    
      const args = [
        "--input-ipc-server=" + PIPE_PATH,
        "--idle=yes",
        "--keep-open=yes",
        "--no-terminal",
      ];
      if (filePath) args.push(filePath);
    
      const proc = spawn(MPV_BINARY, args, {
        detached: true,
        stdio: "ignore",
        windowsHide: false,
      });
      proc.unref();
    
      // Wait for pipe to be ready
      for (let i = 0; i < 20; i++) {
        await new Promise((r) => setTimeout(r, 250));
        if (await isMpvRunning()) return { started: true };
      }
      throw new Error(
        "mpv failed to start. Make sure mpv is installed and in PATH, or set MPV_PATH environment variable."
      );
    }
Behavior4/5

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

With no annotations, the description carries full burden. It explicitly states both actions: stopping playback and clearing the file. This is sufficient for a simple tool.

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?

Extremely concise and front-loaded. Every word is necessary and earns its place.

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 zero-parameter tool with no outputs, the description fully covers the behavior. No additional detail is needed.

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?

No parameters exist, so schema coverage is 100%. The description adds meaning beyond the empty schema by clarifying the tool's effect.

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 'stop' and resource 'playback', and adds 'clear the current file' which distinguishes it from siblings like player_pause that only pause without clearing.

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?

No guidance on when to use stop versus pause or other siblings. The description does not provide context for choosing this tool over alternatives.

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