Skip to main content
Glama

Apply Template

apply_template

Insert a resolved builtin component package into an existing project. Pass template as the selected builtin id and body with projectId, the resolved documentSha256, insert:{startTime,idPrefix}, parameter values and explicit media bindings. Read get_composition first and retain expectedRevision, commandId, componentExecutionVersions:[3,4] and expectedBrandIdentity as required by the contract. Insertion preserves existing timeline content and package source offsets. Select pinned samples explicitly with media:{slot:{sample:true}}, or bind real media IDs. Missing required media is refused; samples are never selected implicitly. A stale revision, pin or brand refuses; do not silently refresh the witness. For ordinary templates, this operation retains its existing apply behavior.

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

Input Schema

NameRequiredDescriptionDefault
bodyYes
templateYestemplate (path).
commandIdNoRetry identity. A call repeated with the same commandId returns the first result instead of acting twice.

Output Schema

NameRequiredDescriptionDefault
etagNo
versionNo
projectIdNo
versionIdNo
componentsNo
templateIdNo
compositionIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / $defs
      Added value: +{
      +  "__schema0": {
      +    "const": 3,
      +    "type": "number"
      +  },
      +  "__schema1": {
      +    "const": 3,
      +    "type": "number"
      +  },
      +  "__schema2": {
      +    "const": 4,
      +    "type": "number"
      +  },
      +  "__schema3": {
      +    "maxLength": 128,
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • changedInput schema / properties / body / properties / componentExecutionVersions / anyOf
      Previous value: -[
      -  {
      -    "items": false,
      -    "maxItems": 1,
      -    "minItems": 1,
      -    "prefixItems": [
      -      {
      -        "const": 3,
      -        "type": "number"
      -      }
      -    ],
      -    "type": "array"
      -  },
      -  {
      -    "items": false,
      -    "maxItems": 2,
      -    "minItems": 2,
      -    "prefixItems": [
      -      {
      -        "const": 3,
      -        "type": "number"
      -      },
      -      {
      -        "const": 4,
      -        "type": "number"
      -      }
      -    ],
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "items": false,
      +    "maxItems": 1,
      +    "minItems": 1,
      +    "prefixItems": [
      +      {
      +        "$ref": "#/$defs/__schema0"
      +      }
      +    ],
      +    "type": "array"
      +  },
      +  {
      +    "items": false,
      +    "maxItems": 2,
      +    "minItems": 2,
      +    "prefixItems": [
      +      {
      +        "$ref": "#/$defs/__schema1"
      +      },
      +      {
      +        "$ref": "#/$defs/__schema2"
      +      }
      +    ],
      +    "type": "array"
      +  }
      +]
    • addedInput schema / properties / commandId / $ref
      Added value: +"#/$defs/__schema3"
    • removedInput schema / properties / commandId / maxLength
      Removed value: -128
    • removedInput schema / properties / commandId / minLength
      Removed value: -1
    • removedInput schema / properties / commandId / type
      Removed value: -"string"
  2. Changed1 schema field changed
    • addedInput schema / properties / commandId
      Added value: +{
      +  "description": "Retry identity. A call repeated with the same commandId returns the first result instead of acting twice.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  3. Changed4 schema fields changed
    • removedInput schema / properties / body / properties / media / default
      Removed value: -{}
    • addedInput schema / properties / body / properties / media / properties
      Added value: +{}
    • removedInput schema / properties / body / properties / values / default
      Removed value: -{}
    • addedInput schema / properties / body / properties / values / properties
      Added value: +{}
  4. Changed5 schema fields changed
    • addedInput schema / properties / body / properties / componentExecutionVersions / anyOf
      Added value: +[
      +  {
      +    "items": false,
      +    "maxItems": 1,
      +    "minItems": 1,
      +    "prefixItems": [
      +      {
      +        "const": 3,
      +        "type": "number"
      +      }
      +    ],
      +    "type": "array"
      +  },
      +  {
      +    "items": false,
      +    "maxItems": 2,
      +    "minItems": 2,
      +    "prefixItems": [
      +      {
      +        "const": 3,
      +        "type": "number"
      +      },
      +      {
      +        "const": 4,
      +        "type": "number"
      +      }
      +    ],
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / body / properties / componentExecutionVersions / items
      Removed value: -{
      -  "const": 3,
      -  "type": "number"
      -}
    • removedInput schema / properties / body / properties / componentExecutionVersions / maxItems
      Removed value: -1
    • removedInput schema / properties / body / properties / componentExecutionVersions / minItems
      Removed value: -1
    • removedInput schema / properties / body / properties / componentExecutionVersions / type
      Removed value: -"array"
  5. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Well beyond the annotations, the description discloses preservation semantics ('preserves existing timeline content and package source offsets'), refusal conditions (missing media, stale revision, stale pin, brand mismatch), and the no-silent-witness-refresh rule. The mutation is non-destructive by design and the description explains why, consistent with destructiveHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded and information-dense, but it is packed with unexplained jargon ('witness', 'package source offsets', 'pin') and the final sentence — 'For ordinary templates, this operation retains its existing apply behavior' — is near-vacuous and adds ambiguity rather than 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?

For a mutating tool with an output schema (so return values need no explanation) and only thin annotations, the description covers prerequisites, refusal behavior, and binding semantics adequately. Remaining gaps are the unexplained 'preset'/'brandKitId' parameters and the absence of any degraded-recovery path when a refusal occurs.

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 67%, and the description compensates on the parts the schema cannot convey: it maps 'template' to the selected builtin id, spells out the required body fields, disambiguates the cryptic componentExecutionVersions consts as [3,4], and explains the two media binding modes. It omits any explanation of 'preset' and 'brandKitId', and does not mention the url media variant the schema permits.

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 first sentence gives a specific verb and resource — 'Insert a resolved builtin component package into an existing project' — and 'resolved' usefully signals the dependency on resolve_builtin_component. It stops short of differentiating this from close siblings like apply_composition or start_template, and the closing line about 'ordinary templates... existing apply behavior' blurs the boundary rather than sharpening it.

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 imposes a prerequisite workflow ('Read get_composition first and retain expectedRevision, commandId, componentExecutionVersions:[3,4] and expectedBrandIdentity') and states selection rules for media bindings. It lacks an explicit 'use this instead of X' routing statement against apply_composition/start_template, which keeps it from a 5.

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.