Skip to main content
Glama

Generate Code Documentation Tool

generate-code-documentation

Use this when the user supplies source code and asks to generate markdown documentation, explain code, or document one or more files. State-changing generation action: consumes AI credits, creates a generation, and returns documentation after authorization. Use browser guidance for local upload or repository/full-tree flows.

Input Schema

NameRequiredDescriptionDefault
nameNoOptional custom name used to identify the documentation in generation history
filesYesArray of files to document. Each file must have filename and source_code properties
output_languageNoOutput language for documentation
documentation_typeNoFree-text style hint for this single document, e.g. 'API Reference', 'Tutorial', 'General Documentation' (the default). This is not a Space's full-tree documentation audience; the hint is included in the generation instructions.
additional_instructionsNoAdditional instructions for documentation generation

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / documentation_type / description
      Previous value: -"Free-text style hint for this single document, e.g. 'API Reference', 'Tutorial', 'General Documentation' (the default). This is NOT a Space's full-tree documentation audience — any string is accepted and passed to the prompt as-is."New value: +"Free-text style hint for this single document, e.g. 'API Reference', 'Tutorial', 'General Documentation' (the default). This is not a Space's full-tree documentation audience; the hint is included in the generation instructions."
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the write nature is known; the description adds genuinely new context: it consumes AI credits, creates a generation record, and requires authorization before returning documentation. It does not describe latency or failure behavior, but the cost/authorization disclosure is meaningful beyond annotations.

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?

Three sentences, front-loaded with the trigger, followed by behavioral cost/side-effect facts. Efficient overall, though the trailing 'use browser guidance for local upload or repository/full-tree flows' is terse and slightly cryptic about where that guidance lives.

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

Completeness4/5

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

For a 5-parameter generation tool with no output schema, the description covers the trigger, side effects, cost, and authorization requirement, plus a pointer for adjacent flows. It leaves the returned documentation's shape and history/retrieval flow implicit, but nothing critical for correct invocation is missing.

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 five parameters (name, files, output_language, documentation_type, additional_instructions). The description adds only that files are the unit of work; it offers no syntax or format guidance beyond the schema, so the 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?

States a specific verb ('generate') and resource ('markdown documentation') and scopes the input to 'one or more files', which separates it from repository/full-tree siblings. It does not name those siblings explicitly, but the 'file-level' scope is clear.

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?

Opens with a concrete trigger ('when the user supplies source code and asks to generate markdown documentation, explain code, or document one or more files') and routes repo/local-upload flows elsewhere via browser guidance. No explicit exclusion naming a sibling tool like generate-full-tree-documentation, so it stops short of 5.

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.