Simplifying Text-to-SQL Agents by Removing 80% of Tools

vercel · Tech · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Internal text-to-SQL data access agent

Vercel needed d0 to answer natural-language analytics questions reliably and quickly, but its original heavily tooled text-to-SQL agent had only 80% success and high maintenance overhead.

Constraints:

Architecture

Vercel replaced an 18-tool specialized d0 agent with a simpler file-system agent: Claude Opus 4.5 runs inside Vercel Sandbox with access to Cube semantic-layer files written as YAML, Markdown, and JSON; it explores context with Unix commands such as grep, cat, find, and ls through a single execute-command tool, then executes SQL through the remaining SQL tool, with Vercel Gateway and Slack/Next.js providing routing and observability.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  A["Slack user question"] --> B["Next.js Slack server"]
  B --> C["Claude Opus 4.5 agent"]
  C --> D["Vercel Sandbox"]
  C --> E["Execute command tool"]
  D --> F["Cube semantic layer files"]
  E --> F
  C --> G["ExecuteSQL tool"]
  G --> H["Analytics infrastructure"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Slack user question Natural-language analytics request from a Vercel employee. Next.js Slack server
Next.js Slack server API route using Vercel Slack Bolt for request handling. Slack user question, Claude Opus 4.5 agent
Claude Opus 4.5 agent ToolLoopAgent that explores files, writes SQL, and explains results. Next.js Slack server, Vercel Sandbox, Execute command tool, ExecuteSQL tool
Vercel Sandbox Execution environment that receives semantic-layer files and runs shell commands. Claude Opus 4.5 agent, Execute command tool, Cube semantic layer files
Execute command tool Single bash-style tool for file exploration with grep, cat, find, ls, and related commands. Claude Opus 4.5 agent, Vercel Sandbox, Cube semantic layer files
Cube semantic layer files YAML, Markdown, and JSON definitions containing dimensions, measures, and joins. Vercel Sandbox, Execute command tool
ExecuteSQL tool Runs the generated SQL against analytics infrastructure. Claude Opus 4.5 agent, Analytics infrastructure
Analytics infrastructure Backend data system queried by d0. ExecuteSQL tool

Data flow

A Slack question reaches d0, Vercel Sandbox receives the semantic-catalog files, Claude browses and greps the Cube semantic layer using a bash command tool, builds SQL from the raw documentation, executes the query, and returns an explanation and results through the Slack-facing service.

3 supporting quotes
“d0 translates natural language questions into SQL queries against our analytics infrastructure, letting anyone on the team get answers without writing code”article, stated
“The file system agent now browses our semantic layer the way a human analyst would.”article, stated
“It reads files, greps for patterns, builds mental models, and writes SQL using standard Unix tools like grep, cat, find, and ls.”article, stated

Why this architecture

Vercel discovered that the semantic layer itself was strong documentation, so removing custom scaffolding let the model reason directly over raw files with fewer tools, fewer tokens, and better success.

3 supporting quotes
“We realized we were fighting gravity. Constraining the model’s reasoning. Summarizing information that it could read on its own.”article, stated
“This works because the semantic layer is already great documentation.”article, stated
“Claude just needed access to read it directly.”article, stated

Models used: Claude Opus 4.5 · ToolLoopAgent

Scale

Alternatives considered (roads not taken)

Specialized schema/search/validation tools

Rejected because: The tools encoded assumptions about model limitations, increased maintenance cost, and constrained reasoning.

“We assumed it would get lost in complex schemas, make bad joins, or hallucinate table names. So we built guardrails.”article, stated

Hand-coded retrieval for schema context

Rejected because: The Cube files already contained legible definitions and joins, so summarizing them for the model was unnecessary.

“We were building tools to summarize what was already legible.”article, stated

Add more patches for every edge case

Rejected because: Each patch created maintenance overhead and model-update recalibration.

“Every edge case meant another patch, and every model update meant re-calibrating our constraints.”article, stated

Patterns

tool-use-orchestration (agent-architecture)

d0 uses a minimal toolset centered on a generic command tool plus SQL execution instead of many specialized tools.

“Addition by subtraction is real. The best agents might be the ones with the fewest tools. Every tool is a choice you’re making for the model. Sometimes the model makes better choices.”article, stated

context-engineering (agent-context)

The agent receives the semantic layer as raw file context and uses Unix search to decide what to read instead of relying on prefiltered summaries.

“This works because the semantic layer is already great documentation. The files contain dimension definitions, measure calculations, and join relationships. We were building tools to summarize what was already legible. Claude just needed access to read it directly.”article, stated
“But simple architecture isn’t enough on its own. The model needs good context to work with. Invest in documentation, clear naming, and well-structured data. That foundation matters more than clever tooling.”article, stated

latency-optimization (performance)

The simplified architecture cut execution time by 3.5x and reduced steps and token usage.

“## Copy link to heading3.5x faster, 37% fewer tokens, 100% success rate”article, stated

Tradeoffs

Expose raw semantic-layer files.

Chose filesystem access and Unix tools over custom schema lookup and retrieval tools.

Rationale: The files were already readable enough for the model, and direct access improved performance.

“So we stopped. The hypothesis was, what if we just give Claude access to the raw Cube DSL files and let it cook? What if bash is all you need? Models are getting smarter and context windows are getting larger, so maybe the best agent architecture is almost no architecture at all.”article, stated

Remove most tools.

Chose few generic tools over many specialized tool choices.

Rationale: Each tool encodes a choice for the model, and in this case the model made better choices itself.

“Addition by subtraction is real. The best agents might be the ones with the fewest tools. Every tool is a choice you’re making for the model. Sometimes the model makes better choices.”article, stated

Accept simpler architecture with stronger context requirements.

Chose model plus file system plus goal over complete scaffolding for every possibility.

Rationale: The simpler path performs well only if context quality is high.

“Start with the simplest possible architecture. Model + file system + goal. Add complexity only when you’ve proven it’s necessary.”article, stated

Gotchas (what bit them)

Over-scaffolding made the agent worse.

Root cause: Vercel constrained reasoning and summarized context the model could read directly.

Resolution: Remove most specialized tools and let Claude inspect the semantic layer with standard file commands.

“Every edge case meant another patch, and every model update meant re-calibrating our constraints. We were spending more time maintaining the scaffolding than improving the agent.”article, stated

Simple file access only works when source files are good context.

Root cause: The approach depends on well-structured, consistently named semantic-layer files.

Resolution: Invest in documentation, naming, and semantic-layer quality before handing raw context to the model.

“If your data layer is a mess of legacy naming conventions and undocumented joins, giving Claude raw file access won’t save you.”article, stated

Model updates can invalidate hand-built constraints.

Root cause: The old agent was calibrated around assumptions about model limitations.

Resolution: Build for improving model capability and add complexity only when proven necessary.

“Models are improving faster than your tooling can keep up. Build for the model that you’ll have in six months, not for the one that you have today.”article, stated

Evaluation

Vercel benchmarked the old tool-heavy architecture against the filesystem approach across five representative queries, comparing execution time, success rate, token usage, steps, and qualitative reasoning.

Metrics: average execution time · success rate · average token usage · average steps · worst-case runtime · worst-case token usage

“We benchmarked the old architecture against the new file system approach across 5 representative queries.”article, stated
“The file system agent won every comparison. The old architecture’s worst case took 724 seconds, 100 steps, and 145,463 tokens before failing. The file system agent completed the same query in 141 seconds with 19 steps and 67,483 tokens, and it actually succeeded.”article, stated

Outcomes

The benchmark was small (five representative queries), but the performance deltas were large and directly tied to a production internal analytics assistant.

3 supporting quotes
“Success rate 4/5 (80%) 5/5 (100%) +20%”article, stated
“Avg steps ~12 steps ~7 steps 42% fewer steps”article, stated
“The qualitative shift matters just as much. The agent catches edge cases we never anticipated and explains its reasoning in ways we can follow.”article, stated