affine_delete_blob
Remove a specific blob/file from workspace storage by specifying the workspace ID and blob key/ID, with an option to delete permanently.
Instructions
Delete a blob/file from workspace storage.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Blob key/ID to delete | |
| permanently | No | Delete permanently | |
| workspaceId | Yes | Workspace ID |
Implementation Reference
- src/tools/blobStorage.ts:57-75 (handler)The asynchronous handler function `deleteBlobHandler` that executes the tool logic: sends a GraphQL mutation to delete a blob from the workspace storage using the provided workspaceId, key, and optional permanently flag.const deleteBlobHandler = async ({ workspaceId, key, permanently = false }: { workspaceId: string; key: string; permanently?: boolean }) => { try { const mutation = ` mutation DeleteBlob($workspaceId: String!, $key: String!, $permanently: Boolean) { deleteBlob(workspaceId: $workspaceId, key: $key, permanently: $permanently) } `; const data = await gql.request<{ deleteBlob: boolean }>(mutation, { workspaceId, key, permanently }); return text({ success: data.deleteBlob, key, workspaceId, permanently }); } catch (error: any) { return text({ error: error.message }); } };
- src/tools/blobStorage.ts:76-88 (registration)Registration of the "affine_delete_blob" tool on the McpServer, specifying title, description, Zod-based input schema, and linking to the deleteBlobHandler.server.registerTool( "affine_delete_blob", { title: "Delete Blob", description: "Delete a blob/file from workspace storage.", inputSchema: { workspaceId: z.string().describe("Workspace ID"), key: z.string().describe("Blob key/ID to delete"), permanently: z.boolean().optional().describe("Delete permanently") } }, deleteBlobHandler as any );
- src/tools/blobStorage.ts:81-85 (schema)Zod schema definition for the tool's input parameters: workspaceId (string), key (string), permanently (optional boolean).inputSchema: { workspaceId: z.string().describe("Workspace ID"), key: z.string().describe("Blob key/ID to delete"), permanently: z.boolean().optional().describe("Delete permanently") }