get_zod_schema
Generate Zod validation schemas with TypeScript types from Pydantic models, FastAPI apps, or OpenAPI URLs, ensuring type-safe frontend validation that matches backend definitions.
Instructions
Generate Zod validation schemas with inferred TypeScript types from a Pydantic model, FastAPI app, or live OpenAPI URL.
Args: target: Target identifier (e.g. 'models.user:UserProfile', 'main:app', 'https://api.example.com/openapi.json'). project_dir: Optional path to the project root directory.
Returns: Zod schema definition code as a string, 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": {
"target": "<target>"
},
"name": "get_zod_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| project_dir | No |