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

TableJSON 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 — any string is accepted and passed to the prompt as-is.
additional_instructionsNoAdditional instructions for documentation generation

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, etc.), the description discloses that this is a 'State-changing generation action' that 'consumes AI credits, creates a generation, and returns documentation after authorization.' This adds valuable side-effect and authorization context that annotations do not provide, though it does not describe return format or failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, both essential. The purpose is front-loaded in the first sentence, and the second sentence adds critical side-effect and routing context. No filler or repetition of schema details.

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 tool with five parameters, all documented in the schema, and no output schema, the description adequately covers when to use it, side effects, and routing guidance. It does not explain the return structure, but that is less critical given the schema and the fact that the description mentions 'returns documentation'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all parameters. The description adds nuance to 'documentation_type' by clarifying it is a free-text style hint and NOT a Space's full-tree documentation audience, which helps avoid misinterpretation. It does not add detail to other parameters but the added clarification lifts it above the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('generate'), resource ('markdown documentation'), and the exact trigger condition ('user supplies source code and asks to generate markdown documentation, explain code, or document one or more files'). It also differentiates from siblings by specifying it handles one or more files, not full-tree or repository flows.

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?

The description tells when to use it ('when the user supplies source code and asks to generate markdown documentation, explain code, or document one or more files') and points to browser guidance for local upload or repository/full-tree flows, which indirectly steers away from siblings like generate-repository-documentation. However, it does not explicitly name alternatives or state when not to use this tool, leaving some inference.

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.

Resources