Skip to main content
Glama

Apply Domain Template

lexq_domain_templates_apply

Apply a domain template to the current tenant. Creates the template's fact definitions and a new policy group pre-populated with its sample rules as a DRAFT version. Apply never overwrites existing schema: a key that already exists with the same definition is kept as it is. Run lexq_domain_templates_preview first. If its factConflicts is not empty, apply fails with P-061 and creates nothing until those facts are deleted or changed to match the template. A template whose isAvailable is false cannot be applied.

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>"
    },
    "name": "lexq_domain_templates_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
templateYesDomain template key to apply (e.g. ECOMMERCE).
customNameNoOptional custom name for the policy group that gets created. If omitted, the template's default name is used.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, destructiveHint=false and openWorldHint=false; the description goes well beyond them by disclosing the write effects (facts created, policy group created as DRAFT), the non-destructive merge semantics (an existing key with the same definition is kept as-is, never overwritten), and the atomic failure mode where P-061 means nothing is created.

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?

Five short sentences, each front-loaded with a distinct fact: action, effects, merge semantics, prerequisite, and failure condition. There is no filler or repetition, and the most decision-relevant constraint (preview first) sits before the failure details.

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 mutation tool with no output schema, the description covers effects, prerequisites, and failure modes thoroughly. The one remaining gap is that it never indicates what the call returns (e.g. created group or fact identifiers), which matters for follow-up calls since no output schema exists to fill that in.

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%, so both `template` and `customName` are already documented in the schema, including the default-name fallback behavior. The description adds no format, example, or constraint detail about these parameters beyond what the schema provides, so baseline 3 applies.

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?

States a specific verb and resource ("Apply a domain template to the current tenant") and immediately enumerates the side effects: fact definitions plus a new policy group with sample rules as a DRAFT version. It also distinguishes itself from the sibling lexq_domain_templates_preview and lexq_domain_templates_list by naming the preview tool as a prerequisite step.

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

Usage Guidelines5/5

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

Gives explicit ordering guidance ("Run lexq_domain_templates_preview first"), a hard precondition (factConflicts must be empty or apply fails with P-061), and an exclusion (a template with isAvailable false cannot be applied). The agent knows both when to call it and when the call will be rejected.

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.