Skip to main content
Glama

get_stream_analytics

Retrieve stream analytics including viewer counts, engagement metrics, and performance data for monitoring streaming channel performance across platforms.

Instructions

Get analytics and statistics for streams including viewer counts, engagement metrics, and performance data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
streamIdNoOptional stream ID to get analytics for a specific stream. If not provided, returns analytics for the current user

Implementation Reference

  • The core implementation of the getStreamAnalytics tool. Fetches analytics data from the Restream API endpoint, either for a specific stream by ID or user-level analytics. Handles authentication and errors via the class methods.
    async getStreamAnalytics(streamId?: string): Promise<any> { try { const endpoint = streamId ? `/streams/${streamId}/analytics` : '/user/analytics'; const response = await this.axiosInstance.get(endpoint); return response.data; } catch (error) { throw this.handleError(error, 'Failed to fetch stream analytics'); } }
  • src/index.ts:123-135 (registration)
    Registers the 'get_stream_analytics' tool in the MCP tools list, including its name, description, and input schema definition.
    { name: 'get_stream_analytics', description: 'Get analytics and statistics for streams including viewer counts, engagement metrics, and performance data', inputSchema: { type: 'object', properties: { streamId: { type: 'string', description: 'Optional stream ID to get analytics for a specific stream. If not provided, returns analytics for the current user', }, }, }, },
  • The MCP server request handler for the 'get_stream_analytics' tool. Parses input arguments, calls the RestreamClient method, and formats the response as MCP content.
    case 'get_stream_analytics': { const analytics = await restreamClient.getStreamAnalytics( args && typeof args.streamId === 'string' ? args.streamId : undefined ); return { content: [ { type: 'text', text: JSON.stringify(analytics, null, 2), }, ], }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shaktech786/restream-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server