get_openapi_schema
Retrieve the complete OpenAPI schema from a FastAPI app, router, factory function, or live HTTP URL by supplying an import string and optional project directory.
Instructions
Extract the complete OpenAPI schema from a local FastAPI app, APIRouter, factory function, or live HTTP URL.
Args: app_path: Import string pointing to the target (e.g. 'main:app', 'routers.users:router', 'https://api.example.com/openapi.json'). project_dir: Optional path to the project root directory. Defaults to current working directory.
Returns: The OpenAPI specification dictionary or an error dictionary.
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": {
"app_path": "<app_path>"
},
"name": "get_openapi_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_path | Yes | ||
| project_dir | No |