Skip to main content
Glama
wave-av

WAVE MCP Server

Official
by wave-av

wave_get_stream_metrics

Analyze live stream health with metrics on bitrate, latency, quality, and errors to identify and troubleshoot performance issues over time.

Instructions

Get detailed performance metrics for a stream including bitrate, latency, quality scores, and error rates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stream_idYesThe UUID of the stream
periodNoTime period for metrics aggregation (default: 24h)
granularityNoData point granularity (default: 5m)

Implementation Reference

  • Handler function for wave_get_stream_metrics tool. Builds query params for period/granularity, calls GET /api/v1/analytics/streams/{stream_id}/metrics, and returns the response body or error.
      async ({ stream_id, period, granularity }) => {
        const params = new URLSearchParams();
        if (period) params.set("period", period);
        if (granularity) params.set("granularity", granularity);
    
        const query = params.toString();
        const path = `/api/v1/analytics/streams/${stream_id}/metrics${query ? `?${query}` : ""}`;
        const res = await waveFetch(path);
        if (!res.ok) return errorContent(res.status, res.body);
    
        return textContent(res.body);
      },
    );
  • Schema definition for wave_get_stream_metrics accepting stream_id (UUID, required), period (enum: 1h/6h/24h/7d/30d, optional), and granularity (enum: 1m/5m/1h/1d, optional).
    {
      stream_id: z.string().uuid().describe("The UUID of the stream"),
      period: z
        .enum(["1h", "6h", "24h", "7d", "30d"])
        .optional()
        .describe("Time period for metrics aggregation (default: 24h)"),
      granularity: z
        .enum(["1m", "5m", "1h", "1d"])
        .optional()
        .describe("Data point granularity (default: 5m)"),
    },
  • Registration call: server.tool('wave_get_stream_metrics', ...) within registerAnalyticsTools function.
    server.tool(
      "wave_get_stream_metrics",
      "Get detailed performance metrics for a stream including bitrate, latency, quality scores, and error rates",
      {
        stream_id: z.string().uuid().describe("The UUID of the stream"),
        period: z
          .enum(["1h", "6h", "24h", "7d", "30d"])
          .optional()
          .describe("Time period for metrics aggregation (default: 24h)"),
        granularity: z
          .enum(["1m", "5m", "1h", "1d"])
          .optional()
          .describe("Data point granularity (default: 5m)"),
      },
      async ({ stream_id, period, granularity }) => {
        const params = new URLSearchParams();
        if (period) params.set("period", period);
        if (granularity) params.set("granularity", granularity);
    
        const query = params.toString();
        const path = `/api/v1/analytics/streams/${stream_id}/metrics${query ? `?${query}` : ""}`;
        const res = await waveFetch(path);
        if (!res.ok) return errorContent(res.status, res.body);
    
        return textContent(res.body);
      },
    );
  • src/server.ts:22-24 (registration)
    registerAnalyticsTools(server) is called from server.ts to register all analytics tools including wave_get_stream_metrics.
    registerAnalyticsTools(server);
    registerBillingTools(server);
    registerProductionTools(server);
  • waveFetch helper used by the handler to make authenticated HTTP requests to the Wave API.
    async function waveFetch(
      path: string,
      init?: RequestInit,
    ): Promise<{ ok: boolean; status: number; body: string }> {
      const url = `${getBaseUrl()}${path}`;
      const res = await fetch(url, {
        ...init,
        headers: {
          ...getAuthHeaders(),
          ...init?.headers,
        },
      });
      const body = await res.text();
      return { ok: res.ok, status: res.status, body };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description bears full burden. It only states what metrics are returned but does not disclose whether the operation is read-only, any side effects, permission requirements, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that is concise and front-loaded with the main action. No redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has 3 parameters, no output schema, and the description is too brief. It does not explain return structure, error handling, or aggregation behavior, leaving significant gaps for an agent to understand the tool fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with clear descriptions for each parameter. The tool description adds context about the types of metrics but does not significantly enhance understanding of the parameters beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it gets performance metrics for a stream, listing specific examples like bitrate, latency, quality scores, and error rates. This distinguishes it from sibling tool 'wave_get_stream_health' which likely focuses on health status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like wave_get_stream_health or wave_list_streams. No mention of prerequisites or context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/wave-av/mcp-server'

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