Skip to main content
Glama

player_set_volume

Set the playback volume of an mpv media player session to any level from 0 (silent) to 130 (maximum), with 100 as the default normal volume.

Instructions

Set playback volume (0–130). 100 is default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
volumeYesVolume level 0–130

Implementation Reference

  • The handler case for 'player_set_volume' tool. It ensures mpv is running, sets the volume property (clamped to 0-130), and returns a success message.
    case "player_set_volume": {
      await ensureMpv();
      await setProperty("volume", Math.max(0, Math.min(130, args.volume)));
      return ok(`Volume set to ${args.volume}`);
    }
  • Tool definition and input schema for 'player_set_volume', including name, description, and input schema with a required 'volume' number (0-130).
    {
      name: "player_set_volume",
      description: "Set playback volume (0–130). 100 is default.",
      inputSchema: {
        type: "object",
        properties: {
          volume: { type: "number", description: "Volume level 0–130" },
        },
        required: ["volume"],
      },
    },
  • index.js:724-724 (registration)
    Registration of all tools via ListToolsRequestSchema handler, which includes 'player_set_volume' in the TOOLS array.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
  • index.js:726-729 (registration)
    CallToolRequestSchema handler that dispatches tool calls (including 'player_set_volume') to the handleTool function.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      return handleTool(name, args || {});
    });
  • Helper function setProperty used by the handler to set the volume via mpv IPC.
    async function setProperty(prop, value) {
      return ipcCommand({ command: ["set_property", prop, value], request_id: reqId++ });
    }
Behavior3/5

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

With no annotations, the description must carry the burden. It adds the default value but does not disclose other behavioral traits like persistence or side effects on playback.

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 with no wasted words. Single sentence effectively communicates purpose, range, and default.

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?

For a simple one-parameter tool with no output schema, the description covers the essential range and default. Could be slightly more comprehensive (e.g., integer constraint), but adequate.

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 coverage is 100% and description adds the default value (100) not present in schema. Adds meaningful context beyond 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 verb 'Set', the resource 'playback volume', and provides a range (0–130) and default (100). This distinguishes it from sibling tools like player_seek or player_set_speed.

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 this tool versus alternatives (e.g., other volume-related tools are absent). Lacks explicit context or exclusions.

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