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; 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.8/5.0
Behavior4/5

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

Annotations only flag readOnlyHint=false, openWorldHint=false, destructiveHint=false. The description adds materially useful behavior beyond those: it is state-changing, consumes AI credits, creates a generation, and returns documentation only after authorization. These disclosures (costs, side effects, auth requirement) are exactly the kind of context annotations don't carry. No contradiction with the 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 with the primary purpose front-loaded and no filler. The 'Use browser guidance...' sentence is efficient but slightly cryptic jargon. Overall the description is appropriately sized and every sentence carries information.

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?

The description covers purpose, side effects (credits, authorization), and a usage boundary, which is good. However, given a very large sibling set with several near-identical generators (generate-codebase-documentation, generate-full-tree-documentation, generate-repository-documentation), sharper differentiation would help. It also gives minimal return-value detail despite there being no output schema.

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 fully documents all 5 parameters; the baseline is 3. The description's mention of 'document one or more files' loosely echoes the files parameter but adds no syntax, format, or constraint detail beyond what the schema already provides. It does not compensate for or extend the schema in any meaningful way.

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 states a specific verb and resource ('generate markdown documentation' for user-supplied source code) and the trigger condition ('asks to... explain code, or document one or more files'). It signals a per-file/multi-file scope and separates that from repository/full-tree flows, which helps an agent distinguish it from siblings like generate-repository-documentation and generate-full-tree-documentation, though it never names those alternatives explicitly.

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?

It opens with 'Use this when the user supplies source code and asks to generate markdown documentation...' and closes by steering local-upload and repository/full-tree flows to browser guidance. This gives clear invocation conditions and an explicit exclusion, but it doesn't name the specific sibling tools to fall back on, leaving some routing to 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