Skip to main content
Glama

update_template_metadata

Update template metadata including name, comment, category, tags, deployment time, or expiration. Use deployedAt to activate a version 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

  • The handler function for update_template_metadata. It accepts templateId, name, comment, category, tags, deployedAt, and expireAt, and delegates to client.updateTemplate(). Returns success or error content.
    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) }],
        };
      }
    }
  • The input schema definition for update_template_metadata using Zod. Defines templateId (required string) and optional fields: name, comment, category, tags, deployedAt, expireAt.
    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 update_template_metadata with the MCP server via server.registerTool(), binding the name, description, inputSchema, and handler.
    server.registerTool(
      updateTemplateMetadataToolName,
      { description: updateTemplateMetadataDescription, inputSchema: updateTemplateMetadataSchema },
      (args, extra) => handleUpdateTemplateMetadata(args, client, { apiKey: extra.authInfo?.token })
    );
  • CarboneClient.updateTemplate method that sends a PATCH request to /template/{id} with optional metadata fields. This is the actual API call invoked by the handler.
    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);
    }
  • Validation schema UpdateTemplateSchema defined with Zod, providing an alternative schema definition for update template metadata.
    export const UpdateTemplateSchema = z.object({
      templateId: z.string().min(1, 'Template ID required'),
      name:       z.string().optional(),
      comment:    z.string().optional(),
      category:   z.string().optional(),
      tags:       z.array(z.string()).optional(),
      // Unix timestamps (seconds). Pass 42000000000 to mean "deploy/expire NOW".
      deployedAt: z.number().int().optional(),
      expireAt:   z.number().int().optional(),
    });
Behavior5/5

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

No annotations are provided, so description carries full burden. It discloses key behaviors: template ID vs version ID scoping, tags replace entirely, special value 42000000000 for immediate deploy/delete, and the effect of deployedAt on rendering.

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?

Two sentences, front-loaded with main purpose, no redundant words. Every sentence contributes essential information.

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 no output schema and 7 parameters, the description covers all parameters' purpose and behavior fully. No gaps remain for an agent to understand 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?

Schema coverage is 100% (baseline 3), but description adds significant value: explains templateId vs version ID semantics, the special constant 42000000000, and tags replacement behavior. This goes well beyond the schema descriptions.

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 the verb 'Update', the resource 'metadata of a stored template', and enumerates the specific fields (name, comment, category, tags, deployment timestamp, or expiration). This clearly distinguishes it from sibling tools like delete_template 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 Guidelines4/5

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

The description explicitly explains when to use deployedAt and expireAt parameters, and hints at the version vs template ID scope. While it doesn't explicitly state when not to use the tool, the context of sibling tools makes it clear.

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