Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

Delete Asset

delete_asset

Remove assets from ElmapiCMS by specifying their UUID to manage content storage and organization.

Instructions

Delete an asset by UUID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesThe asset UUID

Implementation Reference

  • The delete_asset tool handler that accepts a UUID parameter and calls client.delete() to remove the asset from the API, returning the result as JSON.
    // ── delete_asset ──────────────────────────────────────────────────
    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) }],
      };
    });
  • Schema definition for delete_asset tool including title, description, and inputSchema with a single 'uuid' string parameter.
    server.registerTool("delete_asset", {
      title: "Delete Asset",
      description: "Delete an asset by UUID",
      inputSchema: {
        uuid: z.string().describe("The asset UUID"),
      },
  • Registration of the delete_asset tool with the MCP server using server.registerTool().
    server.registerTool("delete_asset", {
  • The ElmapiClient.delete() method that performs the actual HTTP DELETE request to the API endpoint.
    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);
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/elmapicms/elmapicms-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server