stream_stop
Stop an active screenshot stream by providing its ID. Frames already on disk are preserved.
Instructions
Stop a running stream early. Frames already on disk remain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:233-234 (handler)The handler for the 'stream_stop' tool: extracts the 'id' argument and calls stopStream() from the stream module, returning the result as text.
case "stream_stop": return text(stopStream(strArg(args, "id"))); - src/stream.ts:80-87 (helper)The core logic: looks up the stream session by ID, clears its interval ticker, marks it as done, and returns the frame count.
export function stopStream(id: string): { id: string; frameCount: number; stopped: boolean } { const sess = sessions.get(id); if (!sess) return { id, frameCount: 0, stopped: false }; if (sess.ticker) clearInterval(sess.ticker); sess.ticker = undefined; sess.done = true; return { id, frameCount: sess.frames.length, stopped: true }; } - src/index.ts:141-149 (registration)Tool registration for 'stream_stop' in the ListToolsRequestSchema handler, defining the tool name, description, and input schema requiring a string 'id'.
{ name: "stream_stop", description: "Stop a running stream early. Frames already on disk remain.", inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string" } }, }, }, - src/stream.ts:21-30 (schema)The StartStreamArgs interface defines the input schema for stream_start; stream_stop only uses a simple string 'id' argument (no dedicated interface needed, handled inline).
export interface StartStreamArgs { intervalSeconds: number; durationSeconds: number; cursorRadius?: number; format?: "png" | "jpeg" | "webp"; quality?: number; maxEdge?: number; ringCapacity?: number; outDir: string; }