Skip to main content
Glama

customize_template

Create or update custom documentation templates with placeholders and metadata to streamline content creation and improve knowledge base organization.

Instructions

Create or update a custom documentation template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesTemplate content with {title} placeholder
metadataNoDefault metadata for the template
templateNameYesName of the template

Implementation Reference

  • Handler function for the 'customize_template' tool. It extracts arguments, stores the custom template in state.templateOverrides, and returns a success response with available templates.
    case "customize_template": {
      const { templateName, content, metadata } = request.params.arguments as {
        templateName: string;
        content: string;
        metadata?: Partial<DocMetadata>;
      };
    
      try {
        state.templateOverrides[templateName] = {
          name: templateName,
          content,
          metadata: metadata || {}
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                message: "Template customized successfully",
                templateName,
                availableTemplates: [
                  ...Object.keys(TEMPLATES),
                  ...Object.keys(state.templateOverrides)
                ]
              }, null, 2)
            }
          ]
        };
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(
          ErrorCode.InternalError,
          `Error customizing template: ${errorMessage}`
        );
      }
    }
  • src/index.ts:575-600 (registration)
    Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for 'customize_template'.
    {
      name: "customize_template",
      description: "Create or update a custom documentation template",
      inputSchema: {
        type: "object",
        properties: {
          templateName: {
            type: "string",
            description: "Name of the template"
          },
          content: {
            type: "string",
            description: "Template content with {title} placeholder"
          },
          metadata: {
            type: "object",
            description: "Default metadata for the template",
            properties: {
              category: { type: "string" },
              tags: { type: "array", items: { type: "string" } }
            }
          }
        },
        required: ["templateName", "content"]
      }
    }
  • Input schema definition for the 'customize_template' tool, specifying parameters like templateName, content, and optional metadata.
    inputSchema: {
      type: "object",
      properties: {
        templateName: {
          type: "string",
          description: "Name of the template"
        },
        content: {
          type: "string",
          description: "Template content with {title} placeholder"
        },
        metadata: {
          type: "object",
          description: "Default metadata for the template",
          properties: {
            category: { type: "string" },
            tags: { type: "array", items: { type: "string" } }
          }
        }
      },
      required: ["templateName", "content"]
    }
  • Interface defining the structure of a DocTemplate used by the customize_template tool for storing custom templates.
    interface DocTemplate {
      name: string;
      content: string;
      metadata: Partial<DocMetadata>;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'create or update', implying a mutation operation, but doesn't specify permissions required, whether changes are reversible, rate limits, or what happens on conflicts (e.g., if a template with the same name exists). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action ('create or update'), making it easy to parse quickly, and every part of the sentence contributes essential information.

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

Completeness2/5

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

Given the tool's complexity (mutation with 3 parameters including nested objects) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, return values, or how 'create or update' is determined (e.g., based on 'templateName' existence), leaving critical gaps for an agent to use it correctly.

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 description coverage is 100%, with clear descriptions for all parameters (e.g., 'Template content with {title} placeholder' for 'content'). The description doesn't add any meaning beyond what the schema provides, such as explaining the purpose of the 'metadata' object or how 'templateName' is used in updates. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb 'create or update' and the resource 'custom documentation template', making the purpose understandable. However, it doesn't differentiate this tool from sibling tools like 'update_doc' or 'update_metadata', which also involve modifications to documentation-related resources, leaving some ambiguity about when to choose this specific template-focused tool.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'update_doc' and 'update_metadata' that might overlap in functionality, there's no indication of prerequisites, specific contexts (e.g., for template management vs. direct document editing), or exclusions, leaving the agent to guess based on tool names alone.

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

Related 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/ryanjoachim/mcp-rtfm'

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