Skip to main content
Glama

delete_template

Delete a Carbone template by marking it for garbage collection. Use template ID to remove all versions or version ID to delete only a specific version.

Instructions

Delete a stored Carbone template. This is a soft delete: the template is marked for garbage collection and removed after a delay (default 24 hours). You can delete by Template ID (removes all versions) or by Version ID (removes only that specific version). For immediate or scheduled deletion, use update_template_metadata with expireAt = 42000000000 (NOW) or a future Unix timestamp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
templateIdYesTemplate ID (64-bit) or Version ID (SHA-256) to delete. Template ID — deletes the template record and all its versions. Version ID — deletes only that specific version, leaving other versions intact. Both formats are returned by upload_template and list_templates.

Implementation Reference

  • The main handler function for the delete_template tool. It calls client.deleteTemplate with the templateId and returns a success/error response.
    export async function handleDeleteTemplate(
      args: { templateId: string },
      client: CarboneClient,
      options?: CallOptions
    ) {
      try {
        await client.deleteTemplate(args.templateId, options);
        return {
          content: [{ type: 'text' as const, text: 'Template deleted successfully.' }],
        };
      } catch (error) {
        return {
          isError: true,
          content: [{ type: 'text' as const, text: formatError(error) }],
        };
      }
    }
  • Input schema for delete_template, defining templateId as a required string with descriptions for Template ID vs Version ID usage.
    export const deleteTemplateSchema = {
      templateId: z
        .string()
        .min(1)
        .describe(
          'Template ID (64-bit) or Version ID (SHA-256) to delete. ' +
          'Template ID — deletes the template record and all its versions. ' +
          'Version ID — deletes only that specific version, leaving other versions intact. ' +
          'Both formats are returned by upload_template and list_templates.'
        ),
    };
  • Registration of the delete_template tool with the MCP server, binding the tool name, description, schema, and handler.
    server.registerTool(
      deleteTemplateToolName,
      { description: deleteTemplateDescription, inputSchema: deleteTemplateSchema },
      (args, extra) => handleDeleteTemplate(args, client, { apiKey: extra.authInfo?.token })
    );
  • The CarboneClient.deleteTemplate method that performs the actual HTTP DELETE request to /template/{id}.
    async deleteTemplate(templateId: string, options?: CallOptions): Promise<void> {
      await this.request(`/template/${templateId}`, { method: 'DELETE' }, options);
    }
  • Zod schema DeleteTemplateSchema used for validation, requiring a non-empty templateId string.
    export const DeleteTemplateSchema = z.object({
      templateId: z.string().min(1, 'Template ID required'),
    });
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that deletion is soft with a 24-hour delay, and explains the different outcomes for Template ID vs Version ID. Without annotations, the description carries full burden and does an excellent job.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences that front-load the primary action ('Delete a stored Carbone template') and then efficiently explain nuances. No fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a single required parameter and no output schema, the description covers behavior, parameter semantics, and even references sibling tools. It is fully adequate for agent decision-making and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'templateId' is fully described in the schema (100% coverage), and the description adds meaningful context about the two ID types and how to obtain them from upload_template and list_templates.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool deletes a Carbone template and distinguishes between deletion by Template ID (all versions) or Version ID (specific version). This differentiates it from sibling tools like update_template_metadata or render_document.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use the tool and when to use an alternative: 'For immediate or scheduled deletion, use update_template_metadata with expireAt = 42000000000 (NOW) or a future Unix timestamp.' This helps the agent choose the right tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/carboneio/carbone-mcp'

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