generate_api
Generate API functions with async/await pattern in a Nuxt 4 codebase. Define name, path, and HTTP methods to create server endpoints.
Instructions
Generate API functions in the target Nuxt 4 codebase. Creates a new API file with async/await pattern.
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": {
"name": "<name>",
"relativePath": "<relativePath>"
},
"name": "generate_api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the API (e.g., 'user', 'products') | |
| relativePath | Yes | Relative path in target (e.g., 'api/users.ts') | |
| module | No | Optional module name to prefix path (e.g., 'deals', 'tickets') | |
| targetPath | No | Optional absolute target path override | |
| methods | No | HTTP methods to generate (get, post, put, delete) |