ORM-running MCP server catches coding agents confidently wrong on N+1 fixes
deusaquilus · reddit · 2026-09-02
A developer built an MCP server that executes JPA mappings against real ORMs (Hibernate, EclipseLink) in a sandboxed H2 database, returning actual SQL statement counts. A coding agent confidently recommended the textbook JOIN FETCH fix for an N+1 in Shopizer, predicting 1 statement — it stayed at 12.
- A single 8-item cart GET request fired 33 SQL statements; agents find N+1s easily but their fixes, sourced from docs and Stack Overflow folklore, often fail
- Probes across Shopizer, Apache Fineract, and Spring PetClinic found setMaxResults silently dropping its LIMIT on collection join fetches, and EclipseLink generating no join for an alias-based nested JOIN FETCH
- The core argument: fetch tools give models more text to reason over; execute tools give them a number they can't think their way around
- Bonus gotcha: Claude.ai has an undocumented 96KB ceiling on the aggregate tools/list response and silently drops your largest tool past it
More from coding & agent
- Anthropic ships official Claude Fable 5.1 prompting guide with 16 fixes for agent pain points — xiaohu · 2026-09-02
- Claude Fable 5.1 prompting guide: 16 official tips and an agent migration checklist — xiaohu · 2026-09-02
- Polar Analytics launches Polar Operator, an AI operator for commerce teams in Slack — JaynitMakwana · 2026-09-02
- $40K of guitar gear won't make you Mike Rutherford — why coding skill still wins with AI agents — JFPuget · 2026-09-02
- Agents-run SEO pipeline: 8 draft PRs in two weeks, most runs under $1 — Pitiful-Surround-285 · 2026-09-02
- Vibe coding beats product hunting: build the exact tool you need — Philmod · 2026-09-02