getStreamerByName
Retrieve detailed information about a specific streamer using their name with the StreamerSongList MCP Server, enabling efficient management of song requests and interactions with streaming platforms.
Instructions
Fetch detailed information about a specific streamer
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| streamerName | Yes | The name of the streamer |
Implementation Reference
- src/index.ts:192-203 (handler)The core handler for the getStreamerByName tool. It resolves the streamer name using getEffectiveStreamer and fetches the streamer details from the StreamerSongList API.case "getStreamerByName": { const streamerName = getEffectiveStreamer((args as any)?.streamerName); const data = await makeApiRequest(`/streamers/${encodeURIComponent(streamerName)}`); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/index.ts:36-45 (schema)Input schema definition for the getStreamerByName tool, specifying the expected 'streamerName' parameter.inputSchema: { type: "object", properties: { streamerName: { type: "string", description: "The name of the streamer", }, }, required: [], },
- src/index.ts:33-46 (registration)Tool registration object including name, description, and schema, added to the tools array for ListToolsRequestSchema.{ name: "getStreamerByName", description: "Fetch detailed information about a specific streamer", inputSchema: { type: "object", properties: { streamerName: { type: "string", description: "The name of the streamer", }, }, required: [], }, },
- src/index.ts:168-172 (helper)Helper function to resolve the streamer name from input arguments or configuration fallback.function getEffectiveStreamer(requestedStreamer?: string): string { if (requestedStreamer) return requestedStreamer; if (defaultStreamer) return defaultStreamer; throw new Error("No streamer specified and no default streamer configured"); }
- src/index.ts:175-184 (helper)Helper function to perform API requests to the StreamerSongList service.async function makeApiRequest(endpoint: string) { const url = `${apiBase}${endpoint}`; const response = await fetch(url); if (!response.ok) { throw new Error(`API request failed: ${response.status} ${response.statusText}`); } return response.json(); }