Skip to main content
Glama

update_template_metadata

Update template metadata including name, category, tags, deployment, or expiration. Set deployedAt to activate a version for rendering or expireAt to schedule deletion.

Instructions

Update the metadata of a stored template: name, comment, category, tags, deployment timestamp, or expiration. Use deployedAt to activate a specific version for rendering. Use expireAt to schedule or trigger immediate deletion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
templateIdYesTemplate ID (64-bit) or Version ID (SHA-256) to update. Using a Template ID updates the metadata shared by all versions. Using a Version ID updates only that specific version.
nameNoNew display name.
commentNoNew free-text comment.
categoryNoNew category.
tagsNoNew list of tags — replaces existing tags entirely.
deployedAtNoUnix timestamp (seconds) to set as the deployment time for this version. Carbone picks the version with the most recent deployedAt when rendering. Use 42000000000 to deploy immediately (special "NOW" value).
expireAtNoUnix timestamp (seconds) at which this template will be automatically deleted. Use 42000000000 to delete immediately.

Implementation Reference

  • Main handler for update_template_metadata. Calls client.updateTemplate(args, options) and returns success or error message.
    export async function handleUpdateTemplateMetadata(
      args: {
        templateId:  string;
        name?:       string;
        comment?:    string;
        category?:   string;
        tags?:       string[];
        deployedAt?: number;
        expireAt?:   number;
      },
      client: CarboneClient,
      options?: CallOptions
    ) {
      try {
        await client.updateTemplate(args, options);
    
        return {
          content: [{ type: 'text' as const, text: 'Template metadata updated successfully.' }],
        };
      } catch (error) {
        return {
          isError: true,
          content: [{ type: 'text' as const, text: formatError(error) }],
        };
      }
    }
  • Input schema definition using Zod for update_template_metadata. Validates templateId, name, comment, category, tags, deployedAt, and expireAt fields.
    export const updateTemplateMetadataSchema = {
      templateId: z
        .string()
        .min(1)
        .describe(
          'Template ID (64-bit) or Version ID (SHA-256) to update. ' +
          'Using a Template ID updates the metadata shared by all versions. ' +
          'Using a Version ID updates only that specific version.'
        ),
      name: z.string().optional().describe('New display name.'),
      comment: z.string().optional().describe('New free-text comment.'),
      category: z.string().optional().describe('New category.'),
      tags: z.array(z.string()).optional().describe('New list of tags — replaces existing tags entirely.'),
      deployedAt: z
        .number()
        .int()
        .optional()
        .describe(
          'Unix timestamp (seconds) to set as the deployment time for this version. ' +
          'Carbone picks the version with the most recent deployedAt when rendering. ' +
          'Use 42000000000 to deploy immediately (special "NOW" value).'
        ),
      expireAt: z
        .number()
        .int()
        .optional()
        .describe(
          'Unix timestamp (seconds) at which this template will be automatically deleted. ' +
          'Use 42000000000 to delete immediately.'
        ),
    };
  • Registration of the update_template_metadata tool with the MCP server, including name, description, input schema, and handler binding.
    server.registerTool(
      updateTemplateMetadataToolName,
      { description: updateTemplateMetadataDescription, inputSchema: updateTemplateMetadataSchema },
      (args, extra) => handleUpdateTemplateMetadata(args, client, { apiKey: extra.authInfo?.token })
    );
  • CarboneClient.updateTemplate() — makes a PATCH /template/{id} API call with the metadata fields to update the template.
    async updateTemplate(params: {
      templateId:  string;
      name?:       string;
      comment?:    string;
      category?:   string;
      tags?:       string[];
      deployedAt?: number;
      expireAt?:   number;
    }, options?: CallOptions): Promise<void> {
      const body: Record<string, unknown> = {};
      if (params.name       !== undefined) body['name']       = params.name;
      if (params.comment    !== undefined) body['comment']    = params.comment;
      if (params.category   !== undefined) body['category']   = params.category;
      if (params.tags       !== undefined) body['tags']       = params.tags;
      if (params.deployedAt !== undefined) body['deployedAt'] = params.deployedAt;
      if (params.expireAt   !== undefined) body['expireAt']   = params.expireAt;
    
      await this.request(`/template/${params.templateId}`, {
        method: 'PATCH',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(body),
      }, options);
    }
  • Imports of updateTemplateMetadataToolName, description, schema, and handler from templates.ts into the registration module.
      updateTemplateMetadataToolName,
      updateTemplateMetadataDescription,
      updateTemplateMetadataSchema,
      handleUpdateTemplateMetadata,
      deleteTemplateToolName,
      deleteTemplateDescription,
      deleteTemplateSchema,
      handleDeleteTemplate,
      downloadTemplateToolName,
      downloadTemplateDescription,
      downloadTemplateSchema,
      handleDownloadTemplate,
    } from './templates.js';
    
    import {
      getApiStatusToolName,
      getApiStatusDescription,
      handleGetApiStatus,
      getCapabilitiesToolName,
      getCapabilitiesDescription,
      handleGetCapabilities,
    } from './info.js';
    
    export function registerTools(server: McpServer, client: CarboneClient): void {
      server.registerTool(
        listTemplatesToolName,
        { description: listTemplatesDescription, inputSchema: listTemplatesSchema },
        (args, extra) => handleListTemplates(args, client, { apiKey: extra.authInfo?.token })
      );
    
      server.registerTool(
        convertDocumentToolName,
        { description: convertDocumentDescription, inputSchema: convertDocumentSchema },
        (args, extra) => handleConvertDocument(args, client, { apiKey: extra.authInfo?.token })
      );
    
      server.registerTool(
        renderDocumentToolName,
        { description: renderDocumentDescription, inputSchema: renderDocumentSchema },
        (args, extra) => handleRenderDocument(args, client, { apiKey: extra.authInfo?.token })
      );
    
      server.registerTool(
        listCategoriesToolName,
        { description: listCategoriesDescription },
        (extra) => handleListCategories({} as never, client, { apiKey: extra.authInfo?.token })
      );
    
      server.registerTool(
        listTagsToolName,
        { description: listTagsDescription },
        (extra) => handleListTags({} as never, client, { apiKey: extra.authInfo?.token })
      );
    
      server.registerTool(
        uploadTemplateToolName,
        { description: uploadTemplateDescription, inputSchema: uploadTemplateSchema },
        (args, extra) => handleUploadTemplate(args, client, { apiKey: extra.authInfo?.token })
      );
    
      server.registerTool(
        updateTemplateMetadataToolName,
        { description: updateTemplateMetadataDescription, inputSchema: updateTemplateMetadataSchema },
        (args, extra) => handleUpdateTemplateMetadata(args, client, { apiKey: extra.authInfo?.token })
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It mentions that expireAt can trigger immediate deletion and deployedAt activates a version. However, it does not state if the operation is destructive or requires authentication, nor does it clarify that tags are replaced entirely (schema provides that detail).

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?

The description consists of two clear, front-loaded sentences with no unnecessary words. It efficiently lists updatable fields and highlights key usage notes for deployedAt and expireAt.

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

Completeness3/5

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

The tool has no output schema and no annotations, so the description must compensate. It explains the purpose and key parameters but omits what the return value is, whether the operation is idempotent, and differences between using templateId vs versionId (only in schema). Still, it covers the main use cases.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already explains each parameter well. The description adds context for deployedAt and expireAt (e.g., special value 42000000000), but most parameter details are already in the schema. Baseline 3 is appropriate.

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 verb 'Update' and the resource 'metadata of a stored template', listing the specific fields (name, comment, category, tags, deployment timestamp, expiration). It distinguishes the tool from sibling operations like delete, download, or render.

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

Usage Guidelines4/5

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

The description provides guidance on when to use deployedAt and expireAt, and explains their effects. However, it does not explicitly exclude alternative tools or mention prerequisites, though the context makes it clear this is for metadata updates.

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