generate_async_data_composable
Generate a useAsyncData composable to replace Nuxt 2 asyncData() or fetch() hooks, simplifying migration to Nuxt 3.
Instructions
Generate a useAsyncData composable to replace Nuxt 2 asyncData() or fetch() lifecycle hooks.
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_async_data_composable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Composable name (e.g., 'usePosts') | |
| relativePath | Yes | Relative path in target (e.g., 'composables/usePosts.ts') | |
| module | No | Optional module name | |
| targetPath | No | Optional absolute target path override | |
| endpoint | No | API endpoint to fetch from | |
| key | No | Cache key for useAsyncData | |
| hasLazyLoad | No | Whether to use lazy loading |