AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Ask Database

skill-spencerpauly-skills-repo-ask-database · by spencerpauly

Answer a natural-language question by writing a SELECT against the user's connected database via the QueryBear MCP. Use when the user asks "how many", "which users", "what's our", "give me a list of", or otherwise asks a question whose answer lives in their database.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add skill-spencerpauly-skills-repo-ask-database

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-spencerpauly-skills-repo-ask-database)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Ask Database? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Ask Database

Translate a question into SQL, run it through QueryBear's read-only gateway, and return the answer in plain language.

When to use

  • The user asks a question whose answer is stored in their database: "how many active subscriptions do we have", "which users haven't logged in in 30 days", "what's the median order value last week".
  • The user pastes a SQL question or asks "can you run this query".

QueryBear is read-only — never propose this skill for INSERT/UPDATE/DELETE/DDL. Mutations will be rejected by the gateway.

Steps

  1. Pick a connection.
  • If the user has only one database, skip discovery and call get_schema and run_query with no connection argument.
  • If they have multiple and you don't know which, call list_connections once and ask the user to pick (or infer from context: "production" vs "staging").
  1. Read the schema once per task with get_schema. Note the relevant tables and column types before writing SQL. Don't guess column names.
  1. Write a focused SELECT.
  • Always include a LIMIT — usually 100 — unless the user explicitly asks for everything.
  • Aggregate when the question is a count, sum, average, or distribution.
  • Prefer one query that answers the question over five exploratory queries.
  1. Run it via run_query. If QueryBear rejects the query (blocked column, blocked table, row-limit hit, timeout), surface the error message verbatim — don't paraphrase or guess around it.
  1. Translate the result back to English. Lead with the answer. Show the underlying SQL underneath in a code block so the user can audit it. If the result is a list of more than ~10 rows, summarize patterns and offer to drill in.

Output format

**Answer:** 

```sql

| col | col | |-----|-----| | ... | ... |


## Don't

- Don't try to mutate. QueryBear blocks it; even attempting wastes a turn.
- Don't `SELECT *` on a wide table without a `LIMIT`.
- Don't guess column names. Re-read the schema if you're unsure.
- Don't return a 500-row table inline. Summarize and offer the full export.

## Reference

QueryBear MCP — read-only SQL gateway with schema introspection, query parsing, and row-limit enforcement. Tools used by this skill: `list_connections`, `get_schema`, `run_query`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [spencerpauly](https://github.com/spencerpauly)
- **Source:** [spencerpauly/skills-repo](https://github.com/spencerpauly/skills-repo)
- **License:** MIT
- **Homepage:** https://skillsovermcp.com

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.