lithtrix_blob_delete
Soft-delete a blob by providing its content-addressed blob ID. Requires a valid LITHTRIX_API_KEY for authorization.
Instructions
Soft-delete a blob (DELETE /v1/blobs/{blob_id}). Requires LITHTRIX_API_KEY.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blob_id | Yes | Content-addressed blob id (b_ + 16 hex chars) |
Implementation Reference
- tools/blobs.js:273-293 (handler)The main handler for the lithtrix_blob_delete tool. It reads the LITHTRIX_API_KEY, sends a DELETE request to /v1/blobs/{blob_id}, and processes the response.
server.tool( "lithtrix_blob_delete", "Soft-delete a blob (DELETE /v1/blobs/{blob_id}). Requires LITHTRIX_API_KEY.", { blob_id: blobIdSchema }, async ({ blob_id }) => { const apiKey = process.env.LITHTRIX_API_KEY; if (!apiKey) return missingApiKeyResponse(); const path = `/v1/blobs/${encodeURIComponent(blob_id)}`; let response; try { response = await fetch(new URL(path, LITHTRIX_API_URL), { method: "DELETE", headers: { Authorization: `Bearer ${apiKey}` }, }); } catch (err) { return networkErrorResponse(err); } return deleteBlobResult(response); } ); - tools/blobs.js:119-131 (helper)Helper function that processes the delete API response. Returns a success JSON if status is 204 (No Content), otherwise falls back to apiJsonResponse.
async function deleteBlobResult(response) { if (response.status === 204) { return { content: [ { type: "text", text: JSON.stringify({ status: "success", deleted: true }, null, 2), }, ], }; } return apiJsonResponse(response); } - tools/blobs.js:10-14 (schema)Zod schema for blob_id parameter validation: a 19-character string matching pattern b_ followed by 16 hex characters.
const blobIdSchema = z .string() .length(19) .regex(/^b_[0-9a-f]{16}$/) .describe("Content-addressed blob id (b_ + 16 hex chars)"); - index.js:48-48 (registration)Registration call in index.js that registers all blob tools (including lithtrix_blob_delete) on the MCP server.
registerBlobTools(server); - tools/blobs.js:133-133 (registration)Export function that registers all blob-related tools on the server. The lithtrix_blob_delete registration begins at line 273 within this function.
export function registerBlobTools(server) {