Generate Code Documentation Tool
generate-code-documentationUse 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.
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": {
"files": "<files>"
},
"name": "generate-code-documentation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional custom name used to identify the documentation in generation history | |
| files | Yes | Array of files to document. Each file must have filename and source_code properties | |
| output_language | No | Output language for documentation | |
| documentation_type | No | 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. | |
| additional_instructions | No | Additional instructions for documentation generation |