Delete Asset
delete_assetRemove an asset from your ElmapiCMS instance by specifying its UUID.
Instructions
Delete an asset by UUID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | The asset UUID |
Implementation Reference
- src/tools/assets.ts:109-120 (handler)The delete_asset tool handler: registers the tool with the MCP server, accepts a UUID string, and calls client.delete(`/files/${uuid}`) to perform the HTTP DELETE request.
server.registerTool("delete_asset", { title: "Delete Asset", description: "Delete an asset by UUID", inputSchema: { uuid: z.string().describe("The asset UUID"), }, }, async ({ uuid }) => { const result = await client.delete(`/files/${uuid}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); - src/tools/assets.ts:112-114 (schema)Input schema for delete_asset: requires a single 'uuid' string field describing the asset UUID.
inputSchema: { uuid: z.string().describe("The asset UUID"), }, - src/index.ts:39-39 (registration)Registration call in index.ts: registerAssetTools is called with the MCP server and client instance, which registers the delete_asset tool.
registerAssetTools(server, client); - src/client.ts:134-142 (helper)The client.delete helper method used by the tool handler to make the HTTP DELETE request to the ElmapiCMS API.
async delete(path: string, body?: unknown): Promise<unknown> { const response = await fetch(`${this.baseUrl}${path}`, { method: "DELETE", headers: this.headers(), body: body ? JSON.stringify(body) : undefined, }); return this.handleResponse(response); }