Skip to main content
Glama

generate-code

Generates code from a natural-language task description; optionally specify language, framework, model, or constraints to tailor the output.

Instructions

Generates code based on a natural language description of the task

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": {
      "task": "<task>"
    },
    "name": "generate-code"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskYesThe coding task to perform (e.g., 'create a React component', 'write a Python function to sort a list')
modelNoOptional model to use (e.g., 'qwen-turbo'). If not specified, uses the default model (qwen-plus).
languageNoProgramming language to use (e.g., 'python', 'javascript', 'java', 'cpp'). If not specified, Qwen will choose the most appropriate language.
frameworkNoFramework or library to use (e.g., 'React', 'Vue', 'Django', 'Express')
requirementsNoSpecific requirements or constraints for the code

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

C2.9/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 and falls short. It does not say whether generated code is returned as text, written to a file, or executed; nor does it disclose model defaults as a behavioral constraint (that only appears in the schema), rate limits, or side effects. For a generation tool with zero annotation coverage this is a meaningful gap.

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?

A single well-formed sentence with no filler, and the core purpose is front-loaded in the opening words. Its brevity costs informativeness rather than reflecting tight editing of rich content.

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?

With 5 parameters, no annotations, and no output schema, the definition should clarify the return shape (code block versus file) and the effect of combining language, framework, and requirements. None of that is present, leaving the agent under-informed about a moderately complex tool.

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 every parameter including task, model, language, framework, and requirements is already documented with examples and defaults in the schema. The description adds no meaning beyond that, so the baseline of 3 applies rather than anything higher.

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?

States a specific verb and output ("Generates code") plus the input modality ("based on a natural language description of the task"). That distinguishes it in substance from explain-code, refactor-code, and review-code, but the description never names or routes against those siblings explicitly.

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?

No when-to-use guidance at all: nothing says when to pick generate-code over ask-qwen or brainstorm, nor any prerequisite such as supplying a language or framework. The agent must infer selection purely from the tool name.

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