Skip to main content
Glama

generate_code

Generate production-ready code for a feature in your target language. Produces a structured prompt the host LLM runs to output code, tests, logging, error handling, and docs.

Instructions

Generate clean, scalable, production-ready code for a feature. Returns a structured prompt the host LLM executes to produce code, tests, logging, error handling, and docs following industry best practices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoSurrounding architecture: frameworks in use, conventions, neighbouring services.
featureYesPlain-English description of the feature or component to build.
languageYesTarget language/runtime, e.g. 'TypeScript', 'Java 21 + Spring Boot 3'.
constraintsNoHard constraints (latency budgets, compliance, library versions, etc.).
includeDocsNoGenerate inline + module-level documentation.
includeTestsNoGenerate unit + integration tests.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose a genuinely non-obvious trait — the tool returns a structured prompt the host LLM executes rather than writing code itself, implying a read-only/analysis posture — but says nothing about permissions, whether any files are written, or invocation limits.

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 sentences, front-loaded with the core action and then the return behavior. 'clean, scalable, production-ready' is mild marketing padding, but nothing is redundant enough to waste space.

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?

With no output schema and no annotations, the description does explain the return value (a structured prompt), which is the most important missing piece. It still leaves the agent unsure how this differs from scaffold_service or whether constraints/includeDocs actually alter the prompt content.

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 the schema already documents all six parameters, including defaults for includeTests and includeDocs. The description adds no syntax, format, or constraint-interpretation guidance beyond the schema, so baseline 3 applies.

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 specific verb ('Generate') and resource ('code for a feature') plus the artifacts produced (tests, logging, error handling, docs). However, it never distinguishes itself from close siblings like scaffold_service, generate_test_cases, or generate_documentation, which an agent would need to route between.

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

Usage Guidelines2/5

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

There is no explicit when-to-use, when-not-to-use, or alternative named anywhere in the description. Given the crowded sibling set (scaffold_service, generate_test_cases, generate_documentation, generate_implementation_plan), the absence of routing guidance is a real gap.

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