Generate Documentation
generate_docsGenerate accurate documentation for existing code by choosing docstring, README, or API reference style. Provide code and language to receive structured docs ready for review.
Instructions
Generate documentation for existing code.
Produces documentation in the requested style — inline docstrings, README content, or structured API reference.
IMPORTANT: Always review the returned documentation for accuracy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code to generate documentation for. | |
| style | No | Documentation style: 'docstring' for inline docs, 'readme' for a README section, 'api_reference' for structured API docs. | docstring |
| language | Yes | Programming language of the code. | |
| max_tokens | No | Max tokens override. | |
| temperature | No | Temperature override. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The generated artefact (code, tests, documentation). None on failure. | |
| error | No | Human-readable error message. None on success. | |
| success | Yes | Whether the generation completed successfully. | |
| metadata | No | Auxiliary data: token usage, elapsed time, quality warnings, etc. |