getStreamerByName
Retrieve detailed information about a specific streamer from the StreamerSongList MCP Server to manage song requests and interact with streaming platforms.
Instructions
Fetch detailed information about a specific streamer
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| streamerName | No | The name of the streamer |
Implementation Reference
- src/index.ts:192-203 (handler)Handler implementation for the getStreamerByName tool. Resolves the streamer name using getEffectiveStreamer helper and fetches detailed streamer information from the API endpoint `/streamers/{streamerName}`.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:33-46 (schema)Tool schema definition including name, description, and inputSchema for validating streamerName parameter.{ 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:163-165 (registration)Registration of the ListToolsRequestHandler which exposes the tools array containing getStreamerByName.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools, }));
- src/index.ts:168-172 (helper)Helper function to resolve the effective streamer name, falling back to config default.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 make API requests to the StreamerSongList base URL.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(); }