Generate OpenAPI From Source Code
generate-swagger-apiUse this when the user supplies API source code and asks for an OpenAPI or Swagger specification. After authorization, this state-changing action consumes AI credits, creates a generation, and returns OpenAPI JSON; it accepts one source_code file or multiple files entries and can save the result to a Space, where it may be publicly accessible.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "generate-swagger-api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional generation history name for the generated OpenAPI output. Defaults to the supplied filename or comma-separated filenames. | |
| files | No | Multiple supplied file contents for one OpenAPI spec. Use this when the customer pasted or supplied several files directly; use browser guidance for local uploads. | |
| filename | No | Filename for source_code in the single-file path. Omit when using files[]. | |
| source_code | No | Source code to analyze for a single supplied file. Provide filename too. Omit when using files[]. | |
| save_to_space | No | Optional destination Space item. | |
| additional_instructions | No | Optional generation instructions. |