Skip to main content
Glama
Unified MCP Server

Unified MCP Server

by qingyunyupan

code_generate

Generate Python or JavaScript functions, classes, and components from a natural-language description, with optional style choices for functional, object-oriented, or clean code.

Instructions

根据自然语言描述生成Python或JavaScript代码。支持生成函数、类、组件等各种代码结构,可指定代码风格。

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": {
      "description": "<description>",
      "language": "<language>"
    },
    "name": "code_generate"
  }
}

Input Schema

NameRequiredDescriptionDefault
styleNo代码风格(可选)
languageYes目标编程语言
descriptionYes代码需求描述,详细说明要实现的功能

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

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 it discloses almost nothing: no note on whether output is runnable code, how long generation can run, what happens on an unparsable request, or whether results are deterministic. It only adds that code style can be specified.

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 the core action and language scope, with the capability list second. Nothing is redundant, though the second sentence mostly restates what the schema already implies.

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 three-parameter generation tool with no annotations and no output schema, the definition should say what comes back (raw code block, function stub, dependencies assumed). It covers inputs adequately but leaves the return contract and any constraints unstated.

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% and both enums are self-documenting, so the baseline is 3. The description echoes the style parameter ('可指定代码风格') and hints that the description param should be detailed, but adds no syntax or format guidance beyond the schema.

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+resource pair ('生成Python或JavaScript代码') and scopes it to functions, classes and components, which clearly separates it from sibling tools like code_analyze or code_explain. It stops short of distinguishing itself from the near-neighbor code_complete, which also touches code bodies.

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?

It says code can be generated from a natural-language description, which implicitly positions it against siblings, but there is no explicit when-to-use/when-not-to-use statement and no named alternative for cases like completing existing code or planning an architecture. An agent must infer the boundary itself.

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