misp_delete_attribute
Delete an attribute from MISP, choosing between a soft delete or a permanent hard delete. Provide the attribute ID to remove the indicator from the platform.
Instructions
Delete (soft or hard) an attribute from MISP
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attributeId | Yes | Attribute ID to delete | |
| hard | No | Hard delete (permanent) instead of soft delete |
Implementation Reference
- src/tools/attributes.ts:203-227 (registration)Registration of 'misp_delete_attribute' tool with server.tool(), defining the schema (attributeId: string, hard: optional boolean) and the handler callback.
server.tool( "misp_delete_attribute", "Delete (soft or hard) an attribute from MISP", { attributeId: z.string().describe("Attribute ID to delete"), hard: z.boolean().optional().describe("Hard delete (permanent) instead of soft delete"), }, async ({ attributeId, hard }) => { try { const result = await client.deleteAttribute(attributeId, hard); return { content: [ { type: "text", text: result.message || `Attribute ${attributeId} deleted successfully.` }, ], }; } catch (err) { return { content: [ { type: "text", text: `Error deleting attribute: ${err instanceof Error ? err.message : String(err)}` }, ], isError: true, }; } } ); - src/tools/attributes.ts:210-226 (handler)Handler function that receives { attributeId, hard }, calls client.deleteAttribute(), and returns success/error content.
async ({ attributeId, hard }) => { try { const result = await client.deleteAttribute(attributeId, hard); return { content: [ { type: "text", text: result.message || `Attribute ${attributeId} deleted successfully.` }, ], }; } catch (err) { return { content: [ { type: "text", text: `Error deleting attribute: ${err instanceof Error ? err.message : String(err)}` }, ], isError: true, }; } } - src/tools/attributes.ts:206-209 (schema)Input schema definition for the tool: attributeId (required string) and hard (optional boolean for permanent delete).
{ attributeId: z.string().describe("Attribute ID to delete"), hard: z.boolean().optional().describe("Hard delete (permanent) instead of soft delete"), }, - src/client.ts:331-341 (helper)Client-side implementation of deleteAttribute. Sends POST request to /attributes/delete/{id} with optional { hard: 1 } body for permanent deletion.
async deleteAttribute( attributeId: string, hard = false ): Promise<{ message: string }> { const body = hard ? { hard: 1 } : {}; return this.request<{ message: string }>( "POST", `/attributes/delete/${encodeId(attributeId, "attributeId")}`, body ); }