Skip to main content
Glama

apply_design_pattern

Apply Factory, Strategy, Builder, Observer, etc patterns. Use when: you need a complete pattern implementation from a high-level description. Related: generate_factory, generate_strategy (for specific patterns)

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": {
      "pattern": "<pattern>",
      "context": "<context>"
    },
    "name": "apply_design_pattern"
  }
}

Input Schema

NameRequiredDescriptionDefault
contextYes
patternYes
classNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observed

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the entire behavioral burden. 'Apply' implies a mutation of the codebase or project, yet the description says nothing about side effects, whether files are created or overwritten, prerequisites, or what a failed application does. The phrase 'complete pattern implementation' hints at generated code but never confirms whether anything is written.

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?

Two compact sentences with the core action front-loaded and the sibling routing second; no filler. The 'etc' is a small imprecision, and the parenthetical about specific patterns could be tightened, but the structure is efficient.

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

Completeness2/5

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

A mutation-style code-generation tool with zero annotations, no output schema, and 0% schema coverage demands a far richer description. Key facts an agent needs — what gets produced or modified, where, and what className and context expect — are all missing.

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 0% across three parameters, so the description must compensate and does not. It never explains that 'context' is the high-level description of the desired implementation, nor what 'className' controls (e.g., naming the generated class). Only the pattern list is loosely reflected, and even that is restated as 'etc' rather than mapping to the enum.

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 gives a specific verb ('Apply') and resource ('design pattern') and enumerates representative patterns (Factory, Strategy, Builder, Observer). It is clearly distinguishable from single-pattern siblings like generate_factory. The trailing 'etc' is loose given the schema actually constrains the value to a fixed 7-item enum, but the intent 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 Guidelines4/5

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

It states an explicit trigger ('Use when: you need a complete pattern implementation from a high-level description') and names alternatives with the condition that selects them ('generate_factory, generate_strategy (for specific patterns)'). There is no explicit when-not statement nor guidance on choosing between apply_domain_template or apply_solid_principles, but the routing is mostly clear.

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.