claude_generate_json
Generate structured JSON responses from prompts with built-in validation and retry logic for reliable AI-powered outputs.
Instructions
Generate JSON response with validation and retry
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": {
"prompt": "<prompt>"
},
"name": "claude_generate_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Prompt to pass to Claude CLI | |
| model | No | Model to use (haiku, sonnet, opus). Default: haiku | |
| maxRetries | No | Maximum retry attempts for JSON validation. Default: 3 | |
| jsonSchema | No | JSON Schema to validate output against | |
| systemPrompt | No | Replace default system prompt | |
| appendSystemPrompt | No | Append to default system prompt |