Skip to main content
Glama

get_stream_analytics

Retrieve stream analytics including viewer counts, engagement metrics, and performance data to monitor streaming effectiveness 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

  • Core implementation of the get_stream_analytics tool. Fetches analytics data from the Restream API endpoint, either for a specific stream or user-level analytics.
    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 with the MCP server, providing name, description, and input schema.
    { 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', }, }, }, },
  • Defines the input schema for the get_stream_analytics tool, accepting an optional streamId parameter.
    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', }, }, },
  • MCP server request handler for the tool call. Extracts arguments, invokes the RestreamClient method, and returns formatted JSON response.
    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