Skip to main content
Glama

Update an existing code template

update_code_template
DestructiveIdempotent

Edits a code template in place. Pass only the fields you want to change. Cache-busts the served feed by bumping feed.updatedAt so the next /api/render request rasterises fresh pixels.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "templateId": "<templateId>"
    },
    "name": "update_code_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
widthNo
heightNo
codeCssNo
codeHtmlNo
isActiveNotrue replaces the always-on active template of the same placement.
placementNoMove it to another image; the size must already fit the new ratio (pass width/height too).
templateIdYes
outputFormatNo
backgroundColorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare this as destructive, idempotent, and not read-only, so the safety profile is covered. The description adds valuable non-obvious behavior: it cache-busts the served feed by bumping feed.updatedAt so the next /api/render rasterises fresh pixels. It stops short of explaining what 'destructive' means in practice, such as replacing an active template, but that detail is partly covered in the schema's isActive description.

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?

The description is three short sentences, front-loaded with the core action, and contains no filler. The cache-busting side effect is placed at the end where it belongs. Minor jargon like 'rasterises' is acceptable in context.

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?

For a 10-parameter mutation with a destructive annotation and no output schema, the description covers the edit action, partial-update semantics, and a key side effect. However, it leaves out meaningful consequences such as moving placement or changing isActive, which are only partially described in the schema. It is adequate but not complete enough to fully guide an agent through a destructive update.

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

Parameters2/5

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

Schema description coverage is only 20%, so the description should compensate for the many undocumented parameters. It adds the useful partial-update rule, but does not explain what most fields mean or how codeCss, codeHtml, outputFormat, or backgroundColor affect behavior. It therefore leaves most parameter semantics to bare schema types and constraints.

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 uses a specific verb and resource: 'Edits a code template in place.' This clearly distinguishes it from create_code_template and read-only siblings like get_template. It does not explicitly name an alternative, but the purpose is unambiguous.

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

Usage Guidelines3/5

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

The sentence 'Pass only the fields you want to change' gives useful partial-update guidance, implying this is a PATCH-style edit rather than a full replacement. However, it does not say when to use this versus create_code_template or preview_render, nor does it mention prerequisites or exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources