Agent Client
Structured Output
How to get structured JSON responses from agent tasks using JSON Schema
βI
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How to get structured JSON responses from agent tasks using JSON Schema
agent-client:
claude:
json-schema:
type: object
properties:
summary:
type: string
description: "A brief summary of what was done"
files_changed:
type: array
items:
type: string
description: "List of files that were created or modified"
success:
type: boolean
required:
- summary
- success
AgentClient agentClient = agentClientBuilder.build();
AgentClientResponse response = agentClient.goal("Analyze the project structure")
.workingDirectory(projectDir)
.run();
// Parse the structured response
String result = response.getResult();
JsonNode json = objectMapper.readTree(result);
String summary = json.get("summary").asText();
| Provider | Structured Output | Configuration |
|---|---|---|
| Claude | JSON Schema via json-schema property | Claude Reference |
| Codex | Not currently supported | β |
| Gemini | Not currently supported | β |