Get JSON from ChatGPT
chatgpt_structuredAsk ChatGPT or another configured AI to return machine-readable JSON matching a specified shape for field extraction, classification, or test-data generation.
Instructions
Ask ChatGPT (or any AI, via provider) for a machine-readable JSON object (for example, extracting fields from text, classifying items, or generating test data). Describe the shape you want in json_shape.
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": {
"instruction": "<instruction>",
"json_shape": "<json_shape>"
},
"name": "chatgpt_structured"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | Optional source text or data to work on. | |
| model | No | Model ID for the chosen provider, e.g. 'gpt-5.6-sol' or 'gemini-3.8-flash'. You can also write 'provider:model', e.g. 'xai:grok-4.6'. Leave empty to use that provider's default. | |
| provider | No | Which AI to ask: openai (ChatGPT), anthropic (Claude), gemini, xai (Grok), deepseek, mistral, meta (Llama), perplexity, moonshot (Kimi), qwen, cohere, groq, openrouter, ollama or lmstudio. Leave empty for the default. Run ai_list_providers to see which are configured. | |
| json_shape | Yes | Describe the JSON object wanted, e.g. '{"name": string, "tags": string[]}'. | |
| instruction | Yes | What ChatGPT should produce. | |
| temperature | No | Creativity, 0 to 2. Lower is more focused. Some reasoning models ignore this; the bridge drops it automatically. | |
| reasoning_effort | No | For reasoning models only: how hard the model should think. Higher is slower and more expensive. | |
| max_output_tokens | No | Upper limit on the length of ChatGPT's reply, in tokens. |