get_current_stream
Retrieve details of the active live stream, including title, status, RTMP URL, and viewer count, for monitoring and management.
Instructions
Get information about the current/active stream including title, status, RTMP URL, and viewer count
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:247-257 (handler)MCP tool execution handler for 'get_current_stream' that delegates to RestreamClient.getCurrentStream() and formats the response as MCP content.case 'get_current_stream': { const stream = await restreamClient.getCurrentStream(); return { content: [ { type: 'text', text: stream ? JSON.stringify(stream, null, 2) : 'No active stream', }, ], }; }
- src/restream-client.ts:129-139 (helper)Core implementation of getCurrentStream() method in RestreamClient that fetches the current stream from the Restream API endpoint '/user/stream', handling 404 as null.async getCurrentStream(): Promise<Stream | null> { try { const response = await this.axiosInstance.get<Stream>('/user/stream'); return response.data; } catch (error) { if (axios.isAxiosError(error) && error.response?.status === 404) { return null; // No active stream } throw this.handleError(error, 'Failed to fetch current stream'); } }
- src/index.ts:92-100 (registration)Registration of the 'get_current_stream' tool in the MCP tools list, including name, description, and empty input schema.{ name: 'get_current_stream', description: 'Get information about the current/active stream including title, status, RTMP URL, and viewer count', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/types.ts:35-43 (schema)Type definition for Stream, used as the return type for getCurrentStream, defining the structure of stream information.export interface Stream { id: string; title: string; isLive: boolean; streamKey?: string; rtmpUrl?: string; viewers?: number; startedAt?: string; }