update_channel_status
Enable or disable a specific streaming channel to control its broadcast status across multiple platforms like YouTube, Twitch, and Facebook.
Instructions
Enable or disable a specific streaming channel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | The ID of the channel to update | |
| enabled | Yes | Whether to enable (true) or disable (false) the channel |
Implementation Reference
- src/index.ts:232-245 (handler)MCP server tool handler for 'update_channel_status': validates input arguments, calls RestreamClient.updateChannelStatus, serializes the updated channel to JSON, and returns it in the response format.case 'update_channel_status': { if (!args || typeof args.channelId !== 'string' || typeof args.enabled !== 'boolean') { throw new Error('channelId and enabled are required'); } const channel = await restreamClient.updateChannelStatus(args.channelId, args.enabled); return { content: [ { type: 'text', text: JSON.stringify(channel, null, 2), }, ], }; }
- src/index.ts:74-91 (registration)Registers the 'update_channel_status' tool in the MCP tools list with name, description, and input schema definition.{ name: 'update_channel_status', description: 'Enable or disable a specific streaming channel', inputSchema: { type: 'object', properties: { channelId: { type: 'string', description: 'The ID of the channel to update', }, enabled: { type: 'boolean', description: 'Whether to enable (true) or disable (false) the channel', }, }, required: ['channelId', 'enabled'], }, },
- src/index.ts:77-90 (schema)Input schema for the 'update_channel_status' tool defining parameters channelId (string) and enabled (boolean).inputSchema: { type: 'object', properties: { channelId: { type: 'string', description: 'The ID of the channel to update', }, enabled: { type: 'boolean', description: 'Whether to enable (true) or disable (false) the channel', }, }, required: ['channelId', 'enabled'], },
- src/restream-client.ts:114-124 (helper)RestreamClient helper method that sends a PATCH request to the Restream API to update the enabled status of a channel and returns the updated Channel object.async updateChannelStatus(channelId: string, enabled: boolean): Promise<Channel> { try { const response = await this.axiosInstance.patch<Channel>( `/user/channels/${channelId}`, { enabled } ); return response.data; } catch (error) { throw this.handleError(error, `Failed to update channel ${channelId}`); } }