wave_get_stream_health
Get real-time health metrics like bitrate, frame rate, and latency for a specific stream. Monitor stream performance and identify issues promptly.
Instructions
Get real-time health metrics for a stream including bitrate, frame rate, and latency
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stream_id | Yes | The UUID of the stream to check |
Implementation Reference
- src/tools/streams.ts:141-147 (handler)The async handler function that executes the 'wave_get_stream_health' tool logic. It calls the WAVE API endpoint /api/v1/streams/{stream_id}/health and returns the response body.
async ({ stream_id }) => { const res = await waveFetch(`/api/v1/streams/${stream_id}/health`); if (!res.ok) return errorContent(res.status, res.body); return textContent(res.body); }, ); - src/tools/streams.ts:135-147 (registration)Registration of the 'wave_get_stream_health' tool via server.tool(), with description and Zod schema for the stream_id parameter.
server.tool( "wave_get_stream_health", "Get real-time health metrics for a stream including bitrate, frame rate, and latency", { stream_id: z.string().uuid().describe("The UUID of the stream to check"), }, async ({ stream_id }) => { const res = await waveFetch(`/api/v1/streams/${stream_id}/health`); if (!res.ok) return errorContent(res.status, res.body); return textContent(res.body); }, ); - src/tools/streams.ts:138-139 (schema)Zod input schema for the tool: requires a single 'stream_id' parameter as a UUID string.
{ stream_id: z.string().uuid().describe("The UUID of the stream to check"), - src/tools/streams.ts:5-19 (helper)The waveFetch helper function 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 }; } - src/tools/streams.ts:25-30 (helper)The errorContent helper function used to format error responses.
function errorContent( status: number, body: string, ): { content: Array<{ type: "text"; text: string }> } { return textContent(`Error ${status}: ${body}`); }