wave_list_streams
Retrieve a paginated list of streams in your WAVE account, optionally filtered by status, to manage stream inventories.
Instructions
List all streams in your WAVE account with pagination support
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of streams to return (1-100, default 25) | |
| offset | No | Number of streams to skip for pagination (default 0) | |
| status | No | Filter by stream status |
Implementation Reference
- src/tools/streams.ts:32-68 (handler)Registration function `registerStreamTools` that defines the `wave_list_streams` tool with its schema (limit, offset, status) and handler logic. The handler calls `/api/v1/streams` with query params and returns JSON text.
export function registerStreamTools(server: McpServer): void { server.tool( "wave_list_streams", "List all streams in your WAVE account with pagination support", { limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum number of streams to return (1-100, default 25)"), offset: z .number() .int() .min(0) .optional() .describe("Number of streams to skip for pagination (default 0)"), status: z .enum(["active", "idle", "error", "all"]) .optional() .describe("Filter by stream status"), }, async ({ limit, offset, status }) => { const params = new URLSearchParams(); params.set("limit", String(limit ?? 25)); params.set("offset", String(offset ?? 0)); if (status && status !== "all") { params.set("status", status); } const res = await waveFetch(`/api/v1/streams?${params.toString()}`); if (!res.ok) return errorContent(res.status, res.body); return textContent(res.body); }, ); - src/sdk-server.ts:60-78 (registration)Alternative registration of `wave_list_streams` as an SdkTool for the Agent SDK in-process mode. Uses the same schema and handler logic calling `/api/streams`.
const listStreamsTool: SdkTool = { name: "wave_list_streams", description: "List all streams in your WAVE account with pagination", inputSchema: z.object({ limit: z.number().int().min(1).max(100).optional().describe("Max streams (1-100, default 25)"), offset: z.number().int().min(0).optional().describe("Pagination offset"), status: z.enum(["active", "idle", "error", "all"]).optional().describe("Filter by status"), }), handler: async (args) => { const params = new URLSearchParams(); params.set("limit", String(args.limit ?? 25)); params.set("offset", String(args.offset ?? 0)); if (args.status && args.status !== "all") params.set("status", String(args.status)); const res = await waveFetch(`/api/streams?${params}`); if (!res.ok) return { type: "error", error: `Error ${res.status}: ${res.body}` }; return { type: "success", result: res.body }; }, annotations: { readOnly: true, destructive: false, openWorld: false }, }; - src/server.ts:5-5 (registration)Import of `registerStreamTools` from streams.ts, and invocation at line 20 to register the `wave_list_streams` tool on the McpServer.
import { registerStreamTools } from "./tools/streams.js"; - src/tools/streams.ts:5-19 (helper)Helper function `waveFetch` used by the handler to make HTTP requests.
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:1-4 (helper)Imports for zod schema validation, McpServer type, and auth helpers used by the tool handler.
import { z } from "zod"; import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { getAuthHeaders, getBaseUrl } from "../auth.js";