Skip to main content
Glama

generate_factory

Factory pattern implementation for object creation. Use when: you specifically need the Factory pattern with typed products. Related: apply_design_pattern (for auto-selecting 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": {
      "name": "<name>",
      "products": "<products>"
    },
    "name": "generate_factory"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
abstractNo
productsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observed

TDQS

B3.2/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 full behavioral burden. It says nothing about whether generated code overwrites existing files, what language or framework is assumed, whether output is written to disk or returned, or what 'typed products' means concretely, leaving an agent unable to predict the effect of calling it.

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 short sentences, front-loaded with purpose followed by usage and the related alternative. No filler, though the terse 'Use when:' fragment sacrifices a bit of readability for brevity.

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

Completeness3/5

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

For a code-generation tool with no annotations, no output schema, and undocumented parameters, the definition covers the what and the when but omits the deliverable format and side effects. An agent knows when to pick it but not what it will get back or where the code goes.

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 largely does not. 'Typed products' loosely gestures at the products array, but the required name parameter and the abstract boolean (abstract factory vs. factory method?) are left entirely unexplained in both schema and prose.

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 names a concrete artifact (a Factory pattern implementation for object creation) and scopes it to typed products, which is enough to tell it apart from the auto-selecting sibling apply_design_pattern. It stops short of saying what exactly is emitted (file, class, snippet) or in which language, so the resource is clear but the deliverable is not fully specified.

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 an explicit selection rule ('use when you specifically need the Factory pattern with typed products') and names the alternative (apply_design_pattern for auto-selecting patterns). There is no explicit 'do not use when' clause, but the contrast with the auto-select sibling effectively implies the boundary.

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.