Skip to main content
Glama

Save template

save_template

Save a user-owned DSL template so it can be rendered later by ID. Validates the DSL with the catalog before persisting. Free (no credits). Optional sampleData (any JSON value) is stored with the template and returned whenever the template is fetched, preserving the template's binding shape. Optional description is a one-sentence summary surfaced on /templates. Returns { templateId, name, createdAt }.

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": {
      "dsl": "<dsl>",
      "name": "<name>"
    },
    "name": "save_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
dslYesThe builder DSL script to store. It is validated before saving. Up to 512KB.
nameYesDisplay name shown in list_templates results and on the /templates page.
sampleDataNoOptional JSON binding data to persist alongside the template. Returned by get_template.
descriptionNoOne-sentence summary of what the template is for. Shown on /templates list rows and matched by list_templates `q`.

Output Schema

NameRequiredDescriptionDefault
nameYesThe display name as saved.
createdAtYesWhen the template was created, as a UTC 'YYYY-MM-DD HH:MM:SS' timestamp.
templateIdYesUUID of the new template.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / dsl / description
      Previous value: -"The builder DSL script to store, normally one that has passed validate_dsl. Up to 512KB."New value: +"The builder DSL script to store. It is validated before saving. Up to 512KB."
    • changedInput schema / properties / sampleData / description
      Previous value: -"Optional JSON binding data to persist alongside the template. Round-tripped on get_template / modify-template flow."New value: +"Optional JSON binding data to persist alongside the template. Returned by get_template."
    • changedOutput schema / properties / templateId / description
      Previous value: -"UUID of the new template; pass it to render_template, get_template, update_template or delete_template."New value: +"UUID of the new template."
  2. Changed1 schema field changed
    • addedInput schema / properties / sampleData / type
      Added value: +[
      +  "object",
      +  "array",
      +  "string",
      +  "number",
      +  "boolean",
      +  "null"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "createdAt": {
      +      "description": "When the template was created, as a UTC 'YYYY-MM-DD HH:MM:SS' timestamp.",
      +      "type": "string"
      +    },
      +    "name": {
      +      "description": "The display name as saved.",
      +      "type": "string"
      +    },
      +    "templateId": {
      +      "description": "UUID of the new template; pass it to render_template, get_template, update_template or delete_template.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "templateId",
      +    "name",
      +    "createdAt"
      +  ],
      +  "type": "object"
      +}
  4. Changed3 schema fields changed
    • changedInput schema / properties / description / description
      Previous value: -"Optional one-sentence summary (max 280 chars). Surfaced on /templates list rows."New value: +"One-sentence summary of what the template is for. Shown on /templates list rows and matched by list_templates `q`."
    • changedInput schema / properties / dsl / description
      Previous value: -"The builder DSL script (<=512KB)."New value: +"The builder DSL script to store, normally one that has passed validate_dsl. Up to 512KB."
    • changedInput schema / properties / name / description
      Previous value: -"Human-readable template name."New value: +"Display name shown in list_templates results and on the /templates page."
  5. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only declare the write/non-destructive profile; the description adds substantive behavior: the DSL is catalog-validated before persisting, the call costs no credits, and sampleData is preserved and re-emitted on fetch so the binding shape survives. It stops short of saying what happens on validation failure, but the additional context is well beyond what the annotations carry.

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?

Front-loaded with purpose, then validation, cost, optional-field semantics and return shape in a single dense paragraph with no filler. Slightly over-packed but every clause carries information.

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

Completeness4/5

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

A write tool with full schema coverage, annotations, and an output schema; the description covers validation timing, cost, optional-field persistence and return keys. Naming the failure behavior on validation errors is the only real gap.

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 baseline is 3. The description adds modest meaning for sampleData (persisted and returned on fetch, preserving binding shape) and description (one-sentence summary on /templates), but mostly restates what the schema descriptions already say.

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?

States a specific verb and resource ("Save a user-owned DSL template") plus the purpose ("so it can be rendered later by ID"). It does not explicitly differentiate itself from the sibling update_template, leaving the create-vs-modify distinction to inference.

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?

Gives useful context (validated before persisting, free of credits) that helps an agent decide to call it, but never states when to use this versus update_template or get_template. Usage is implied rather than routed.

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