content-delete-generation
Remove a generation and its artifacts from a session to manage content and maintain organization.
Instructions
Delete a generation and all its artifacts from a session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Generation ID to delete | |
| sessionId | Yes | Session ID that owns the generation |
Implementation Reference
- src/tools/content.ts:38-50 (handler)The handler function for the 'content-delete-generation' tool, which performs a DELETE request to remove a generation.
async (params) => { try { // SDK doesn't pass sessionId as query param — use underlying HTTP client const httpClient = (client.content as any).httpClient; const result = await httpClient.request( `/content/generations/${encodeURIComponent(params.id)}`, { method: "DELETE", query: { sessionId: params.sessionId } }, ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (err) { const message = err instanceof Error ? err.message : String(err); return { content: [{ type: "text", text: `Error: ${message}` }], isError: true }; } - src/tools/content.ts:31-37 (registration)Registration of the 'content-delete-generation' tool, including its schema definition.
server.tool( "content-delete-generation", "Delete a generation and all its artifacts from a session.", { id: z.string().describe("Generation ID to delete"), sessionId: z.string().describe("Session ID that owns the generation"), },