Commit 10c43e9
fix: add response_schema guidance to agent system prompt (#5078)
## Summary
- Adds a dedicated **"Specifying the response schema"** subsection to
both the MCP server instructions (`app.py`, used by Claude Desktop /
claude.ai) and the everyrow-cc agent system prompt (`sdk_manager.py`)
- Explicitly documents the `response_schema` parameter for Agent, Rank,
and Single Agent operations with a concrete JSON Schema example
- Calls out the anti-pattern of describing output fields only in the
task prompt (which causes fallback to `DefaultAgentResponse` — a single
`answer` string)
## Context
Investigated session `a1f34a56` (G7 Average Temperatures) on Claude
Desktop where Claude described three structured output fields
(`avg_temp_celsius`, `temp_description`, `data_source`) in the task
prompt but didn't pass a `response_schema`, so all rows got `{"answer":
"..."}` with inconsistent formats.
## Test plan
- [ ] Deploy MCP server to staging and run a multi-field agent operation
via Claude Desktop — verify Claude passes `response_schema` with typed
fields
- [ ] Run same test via everyrow-cc to verify both code paths
- [ ] Verify the schema example matches validation in
`models.py:_validate_response_schema`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sourced from commit d003e1fa451df96c2decf8f0675d3132da3b160f1 parent 354e73b commit 10c43e9
2 files changed
+34
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 102 | + | |
| 103 | + | |
105 | 104 | | |
106 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
107 | 121 | | |
108 | 122 | | |
109 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
247 | 253 | | |
248 | 254 | | |
249 | 255 | | |
| |||
323 | 329 | | |
324 | 330 | | |
325 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
326 | 338 | | |
327 | 339 | | |
328 | 340 | | |
| |||
401 | 413 | | |
402 | 414 | | |
403 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
404 | 421 | | |
405 | 422 | | |
406 | 423 | | |
| |||
409 | 426 | | |
410 | 427 | | |
411 | 428 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | 429 | | |
419 | 430 | | |
420 | 431 | | |
| |||
0 commit comments