getQueue
Fetch and paginate the current song queue for a specific streamer using StreamerSongList MCP Server. Easily manage and view song requests with customizable limits and offsets.
Instructions
View current song queues with pagination support
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of songs to return (default: 50) | |
| offset | No | Number of songs to skip for pagination (default: 0) | |
| streamerName | Yes | The name of the streamer whose queue to fetch |
Implementation Reference
- src/server.js:309-345 (handler)The main handler for the 'getQueue' tool. Fetches the song queue for a given streamer from the API, with support for pagination (limit/offset). Returns JSON-formatted queue data or error messages.case "getQueue": { const { streamerName = defaultStreamer, limit = 50, offset = 0 } = args; if (!streamerName) { throw new Error( "streamerName is required. Provide a streamerName or set the DEFAULT_STREAMER environment variable." ); } try { const response = await fetch(`${API_BASE}/streamers/${encodeURIComponent(streamerName)}/queue?limit=${limit}&offset=${offset}`); if (!response.ok) { return { content: [{ type: "text", text: `Error fetching queue: ${response.status} ${response.statusText}` }] }; } const queueData = await response.json(); return { content: [{ type: "text", text: JSON.stringify(queueData, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}` }] }; } }
- src/server.js:143-165 (schema)Input schema definition for the 'getQueue' tool within the tools registry. Specifies parameters: streamerName (string), limit (number, default 50), offset (number, default 0).name: "getQueue", description: "View current song queues with pagination support", inputSchema: { type: "object", properties: { streamerName: { type: "string", description: "The name of the streamer whose queue to fetch", }, limit: { type: "number", description: "Maximum number of songs to return (default: 50)", default: 50, }, offset: { type: "number", description: "Number of songs to skip for pagination (default: 0)", default: 0, }, }, required: [], }, },
- src/server.js:258-262 (registration)Registers all tools including 'getQueue' by handling ListToolsRequestSchema and returning the tools array.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools, }; });
- src/index.ts:205-218 (handler)TypeScript version of the 'getQueue' tool handler. Uses helper functions getEffectiveStreamer and makeApiRequest to fetch paginated queue data.case "getQueue": { const streamerName = getEffectiveStreamer((args as any)?.streamerName); const limit = (args as any)?.limit || 50; const offset = (args as any)?.offset || 0; const data = await makeApiRequest(`/streamers/${encodeURIComponent(streamerName)}/queue?limit=${limit}&offset=${offset}`); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/index.ts:48-70 (schema)Input schema for 'getQueue' tool in the TypeScript implementation, identical to JS version.name: "getQueue", description: "View current song queues with pagination support", inputSchema: { type: "object", properties: { streamerName: { type: "string", description: "The name of the streamer whose queue to fetch", }, limit: { type: "number", description: "Maximum number of songs to return (default: 50)", default: 50, }, offset: { type: "number", description: "Number of songs to skip for pagination (default: 0)", default: 0, }, }, required: [], }, },