getStreamerByName
Retrieve a streamer's detailed profile and song request settings to manage their queue and requests.
Instructions
Fetch detailed information about a specific streamer
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| streamerName | No | The name of the streamer |
Implementation Reference
- src/index.ts:192-203 (handler)Primary handler for the 'getStreamerByName' tool in the TypeScript module. Resolves the streamer name via getEffectiveStreamer, calls makeApiRequest to fetch /streamers/{name}, and returns the JSON result.
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/server.js:271-307 (handler)JavaScript handler for the 'getStreamerByName' tool. Extracts streamerName from args (falling back to defaultStreamer), fetches from the API, and returns the result or an error message.
case "getStreamerByName": { const { streamerName = defaultStreamer } = 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)}`); if (!response.ok) { return { content: [{ type: "text", text: `Error fetching streamer data: ${response.status} ${response.statusText}` }] }; } const streamerData = await response.json(); return { content: [{ type: "text", text: JSON.stringify(streamerData, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}` }] }; } } - src/index.ts:33-46 (schema)Schema definition for getStreamerByName in TypeScript: defines the inputSchema with an optional 'streamerName' string property.
{ 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/server.js:128-141 (schema)Schema definition for getStreamerByName in JavaScript: defines the inputSchema with an optional 'streamerName' string property.
{ 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:162-165 (registration)Tool registration in TypeScript via server.setRequestHandler(ListToolsRequestSchema), exposing the tools array (which includes getStreamerByName).
// Register tools server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools, }));