player_next
Move forward to the next track or video in the playback queue, continuing media playback without interruption.
Instructions
Skip to the next item in the playlist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:352-356 (schema)Tool definition/schema for player_next - declares the tool name, description, and empty input schema.
{ name: "player_next", description: "Skip to the next item in the playlist.", inputSchema: { type: "object", properties: {} }, }, - index.js:544-555 (handler)Handler for player_next - ensures mpv is running, checks if there is a next track in the playlist (fails if at the end), sends playlist-next command to mpv, ensures playback is unpaused, and returns the title of the next track.
case "player_next": { await ensureMpv(); const plCount = await getProperty("playlist-count").catch(() => 0); const plPos = await getProperty("playlist-pos").catch(() => 0); if (plCount <= 1 || plPos >= plCount - 1) { return fail("已经是最后一首,没有下一曲"); } await mpv("playlist-next", ["weak"]); await setProperty("pause", false); const nextTitle = await getProperty("media-title").catch(() => null); return ok(`Playing next: ${nextTitle || "unknown"}`); } - index.js:724-729 (registration)MCP server registration - tools are listed via ListToolsRequestSchema returning the TOOLS array (which includes player_next), and dispatched via CallToolRequestSchema to handleTool (which handles player_next in the switch case).
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; return handleTool(name, args || {}); });