Skip to content
Back to templates

text-to-sql-query-builder

@randalolson/text-to-sql-query-builder

Use when the user asks a natural-language data question against a database in the current directory and wants a reviewable SQL query back. The agent discovers the schema and SQL dialect from the surrounding context (env vars, migration files, ORM models) before asking the user, drafts the query alongside a written rationale, and checks that the SQL parses in the right dialect, hits real columns, and stays read-only unless the user explicitly asked for a write.

Outcome

Get a trustworthy answer to a data question without writing SQL yourself, as a reviewable query that can't change the data.

Use this template

Your agent fetches this runbook and runs it, revising the output until the verifiers pass.

First time with Goodeye?

Connect your agent over MCP, then ask it to fetch this template by its identifier. Or install the CLI and run the command below.

Connect your agent (Claude Code)
claude mcp add --transport http goodeye https://mcp.goodeye.dev/mcp
Or install the CLI
uv tool install goodeye

Connecting over MCP prompts a quick sign-in. The CLI can fetch and run a public template with no account.

Set up another clientFull quickstart

Fetch or fork

Fetch with CLI
goodeye templates get @randalolson/text-to-sql-query-builder
Fork with CLI
goodeye templates fork @randalolson/text-to-sql-query-builder

Also available from

MCP
get_template(identifier="@randalolson/text-to-sql-query-builder")
REST
curl https://api.goodeye.dev/v1/templates/@randalolson/text-to-sql-query-builder