Easiest way to force Claude to return strict JSON:
- Ask politely in the prompt
- Use temperature 0
- Define a tool with a JSON schema
- Strip braces from the user input
Show answer and solution
Correct answer: C. Define a tool with a JSON schema
The tool-call API forces a schema-shaped response.
Most reliable way to get parsable JSON every time.