Skip to main content
Glama
MCP Prompts Server

MCP Prompts Server

by sparesparrow

Fill a template

apply_template
Read-onlyIdempotent

Fill a template prompt's variables and return the resulting text, flagging missing values and unused variables.

Instructions

Fill a template prompt's {{variables}} and return the resulting text. Only prompts with isTemplate true can be applied. A placeholder with no value stays in the text as written and is named in missing; a value the template does not use is named in unused. {{name^}} inserts the value with its first letter upper-cased.

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": {
      "id": "<id>"
    },
    "name": "apply_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesID of a template prompt
variablesNoValues for the template variables, by name, e.g. {"module": "app"}

Output Schema

NameRequiredDescriptionDefault
idYes
textYesThe template with the given values filled in
unusedYesValues given that the template does not use
missingYesPlaceholders left in the text because no value was given

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv4.1.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / id / minLength
      Added value: +1
    • addedInput schema / properties / variables / default
      Added value: +{}
    • changedInput schema / properties / variables / description
      Previous value: -"Values for the template variables, by name"New value: +"Values for the template variables, by name, e.g. {\"module\": \"app\"}"
    • changedInput schema / required
      Previous value: -[
      -  "id",
      -  "variables"
      -]New value: +[
      +  "id"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "id": {
      +      "type": "string"
      +    },
      +    "missing": {
      +      "description": "Placeholders left in the text because no value was given",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "text": {
      +      "description": "The template with the given values filled in",
      +      "type": "string"
      +    },
      +    "unused": {
      +      "description": "Values given that the template does not use",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "text",
      +    "missing",
      +    "unused"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv4.0.2
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / variables / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  3. First observedv4.0.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuine behavioral detail beyond that: unresolved placeholders are left verbatim and reported in `missing`, and unused values surface in `unused`. However, since an output schema exists, those field names are partially redundant, and the description never states what happens when the id is not a template (error vs. empty result).

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?

Four short sentences, front-loaded with the action and scope, followed by edge-case behavior and the one non-obvious syntax rule. Nothing is repeated and nothing is wasted.

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?

For a two-parameter read-only tool with a full output schema and complete annotations, the description covers purpose, precondition, edge-case reporting, and variable syntax. The only real gap is failure behavior for a non-template id.

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

Parameters4/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, but the description adds meaning the schema lacks: it defines the `{{name^}}` capitalization modifier for variable names and clarifies that `id` must reference a template prompt. The `variables` object semantics are richer than the schema's generic 'Values for the template variables, by name'.

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 opens with a specific verb and resource ('Fill a template prompt's {{variables}} and return the resulting text') and adds a hard scope constraint ('Only prompts with isTemplate true can be applied'), which clearly separates it from get_prompt/update_prompt siblings that operate on prompts generically.

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?

It gives a concrete precondition for use (the prompt must have isTemplate true), which tells the agent when this tool is applicable rather than returning text or mutating a prompt. It does not explicitly name an alternative such as get_prompt for non-template prompts, so it falls short of full when/when-not routing.

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