Skip to main content
Glama

delete_template

Delete a Carbone template by ID. Soft delete marks it for garbage collection with a default 24-hour delay. Use Template ID to remove all versions, or Version ID to remove 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(args.templateId, options) and returns 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 — requires a templateId string (min 1 char) which can be a Template ID (64-bit) or Version ID (SHA-256).
    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.'
        ),
    };
  • Validation schema using Zod — validates templateId is a non-empty string.
    export const DeleteTemplateSchema = z.object({
      templateId: z.string().min(1, 'Template ID required'),
    });
  • Registration of the delete_template tool on the MCP server with its name, description, inputSchema, and handler callback.
    server.registerTool(
      deleteTemplateToolName,
      { description: deleteTemplateDescription, inputSchema: deleteTemplateSchema },
      (args, extra) => handleDeleteTemplate(args, client, { apiKey: extra.authInfo?.token })
    );
  • CarboneClient.deleteTemplate — makes the actual HTTP DELETE request to /template/{id} to perform the soft delete.
    async deleteTemplate(templateId: string, options?: CallOptions): Promise<void> {
      await this.request(`/template/${templateId}`, { method: 'DELETE' }, options);
    }
Behavior5/5

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

Given no annotations, description fully discloses soft delete with 24-hour delay, and the effect of deleting by Template ID vs Version ID.

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

Conciseness4/5

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

Three sentences, each dense with information. Minor redundancy could be trimmed, but overall efficient.

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?

With no output schema and one parameter, description covers behavior, deletion modes, and alternative tool, making it fully informative.

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?

Schema has 100% coverage, but description adds meaning by explaining that templateId can be either a 64-bit Template ID or SHA-256 Version ID, and describes the outcome for each.

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?

Description clearly states it deletes a template (soft delete), distinguishes between deleting by Template ID vs Version ID, and provides specific details about each.

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?

Explicitly explains when to use this tool vs alternative (update_template_metadata for immediate/scheduled deletion), and clarifies how deletion differs by ID type.

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