stream_drop
Discard a finished stream session to free in-memory data while preserving recorded files on disk.
Instructions
Forget a finished stream session (frees its in-memory ring; on-disk files are preserved).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/stream.ts:141-144 (handler)The dropStream function that executes the stream_drop tool logic. It stops the stream via stopStream and then deletes the session from the sessions map.
export function dropStream(id: string): boolean { stopStream(id); return sessions.delete(id); } - src/index.ts:155-163 (registration)Tool registration (name, description, inputSchema) for stream_drop in the ListToolsRequestSchema handler. Requires an 'id' string parameter.
{ name: "stream_drop", description: "Forget a finished stream session (frees its in-memory ring; on-disk files are preserved).", inputSchema: { type: "object", required: ["id"], properties: { id: { type: "string" } }, }, }, - src/index.ts:239-240 (handler)The call-site in the CallToolRequestSchema handler that dispatches 'stream_drop' to the dropStream function and returns the result.
case "stream_drop": return text({ id: strArg(args, "id"), dropped: dropStream(strArg(args, "id")) }); - src/stream.ts:80-87 (helper)stopStream is called by dropStream to stop the stream before deleting the session.
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 }; }