- Home
- Skills
- Data & Databases
- Safe DB Analyst — Verified Joins & Traceable SQL Reports
More screenshots
Works with the AI Agents you already use
Safe DB Analyst — Verified Joins & Traceable SQL Reports
Its readable source is bundled with guided, hash-verified setup: no separate source download is needed for the included version.
$19
Safe DB Analyst — Verified Joins & Traceable SQL Reports
Example session with this skill installed
Using the fictional shop database connected through safe-db-mcp, summarize eligible order value, identify the leading product category, and show the SQL and reconciliation checks. Exclude cancelled and returned orders.
- Read your context and instructions
- Compiled the safe db analyst
Legacy-mode example: the ad hoc queries and join checks below are not permitted in strict mode. Use approved precomputed reporting sources for strict analysis.
Fictional shop analysis example
This illustrative report is assembled from locally verified MCP results. It is not a recorded end-to-end agent session. All data is fictional.
Answer
The fixture contains
835 eligible orders with
314,405.70 in order value after excluding cancelled and returned orders [Q01]. Currency is unspecified in the fixture; no real currency is implied. Camping contributes the largest item value,
118,042.70 [Q03].
Scope
All dates present in the fixture are included. The monthly grouping spans January–September 2026 [Q02]; this is fixture coverage, not proof that September is a complete business month. Dates are stored as ISO calendar dates; no timezone conversion was applied. Order value is not recognized revenue. The fixture does not model tax, shipping, discounts or currency conversion.
Category results [Q03]
| Category | Item value |
|---|---|
| Camping | 118,042.70 |
| Footwear | 70,921.00 |
| Clothing | 60,755.00 |
| Gear | 32,923.00 |
| Bags | 31,764.00 |
Checks
Monthly, category and city groupings each sum to
314,405.70, matching the independently calculated order total. The configured demo relationship path was available. No duplicate order IDs were returned [Q05], and no orphan item-to-order rows were found [Q06]. Other parent-key and orphan checks were not separately performed in this demonstration.
The aggregate outputs below were not truncated. The fixture database hash stayed unchanged; all 13 MCP calls were audited. Those are local test observations, not security guarantees for a customer database. Separate production queries may observe different snapshots.
Query evidence
Q01 — Eligible order count and order value; excludes cancelled and returned orders
SELECT COUNT(*) AS order_count, ROUND(SUM(total), 2) AS order_value FROM orders WHERE status NOT IN ('cancelled', 'returned')
Returned 1 rows; truncated: false.
{
"columns": [
"order_count",
"order_value"
],
"rows": [
[
835,
314405.7
]
],
"row_count": 1,
"truncated": false
}
Q02 — Monthly order values at order grain (SQLite example)
SELECT substr(ordered_on, 1, 7) AS month, COUNT(*) AS order_count, ROUND(SUM(total), 2) AS order_value FROM orders WHERE status NOT IN ('cancelled', 'returned') GROUP BY substr(ordered_on, 1, 7) ORDER BY month
Returned 9 rows; truncated: false.
{
"columns": [
"month",
"order_count",
"order_value"
],
"rows": [
[
"2026-01",
100,
37878.8
],
[
"2026-02",
83,
30137.1
],
[
"2026-03",
97,
35478.5
],
[
"2026-04",
91,
32642.9
],
[
"2026-05",
95,
37742.5
],
[
"2026-06",
104,
39472.8
],
[
"2026-07",
95,
36091.9
],
[
"2026-08",
88,
39203.3
],
[
"2026-09",
82,
25757.9
]
],
"row_count": 9,
"truncated": false
}
Q03 — Item value by product category; sums item amounts rather than repeated order totals
SELECT p.category, ROUND(SUM(i.quantity * i.unit_price), 2) AS item_value FROM order_items i JOIN orders o ON i.order_id = o.id JOIN products p ON i.product_id = p.id WHERE o.status NOT IN ('cancelled', 'returned') GROUP BY p.category ORDER BY item_value DESC, p.category
Returned 5 rows; truncated: false.
{
"columns": [
"category",
"item_value"
],
"rows": [
[
"Camping",
118042.7
],
[
"Footwear",
70921.0
],
[
"Clothing",
60755.0
],
[
"Gear",
32923.0
],
[
"Bags",
31764.0
]
],
"row_count": 5,
"truncated": false
}
Q04 — Eligible order value by customer city without extracting customer contact fields
SELECT c.city, COUNT(*) AS order_count, ROUND(SUM(o.total), 2) AS order_value FROM orders o JOIN customers c ON o.customer_id = c.id WHERE o.status NOT IN ('cancelled', 'returned') GROUP BY c.city ORDER BY order_value DESC, c.city
Returned 6 rows; truncated: false.
{
"columns": [
"city",
"order_count",
"order_value"
],
"rows": [
[
"Riverside",
137,
56185.1
],
[
"Springfield",
164,
53992.6
],
[
"Hillcrest",
147,
53403.6
],
[
"Oakridge",
124,
53403.0
],
[
"Lakeview",
136,
49103.5
],
[
"Fairview",
127,
48317.9
]
],
"row_count": 6,
"truncated": false
}
Q05 — Check that orders.id is unique
SELECT id, COUNT(*) AS copies FROM orders GROUP BY id HAVING COUNT(*) > 1 LIMIT 10
Returned 0 rows; truncated: false.
{
"columns": [
"id",
"copies"
],
"rows": [],
"row_count": 0,
"truncated": false
}
Q06 — Count order items whose parent order is absent
SELECT COUNT(*) AS orphan_items FROM order_items i LEFT JOIN orders o ON i.order_id = o.id WHERE o.id IS NULL
Returned 1 rows; truncated: false.
{
"columns": [
"orphan_items"
],
"rows": [
[
0
]
],
"row_count": 1,
"truncated": false
}
Next action
Confirm the real database’s metric definitions, currency, date boundaries and reviewed relationships before adapting these queries. Do not infer customer schemas from this fictional shop.
Connects securely to your tools. The creator never sees your data.
About this skill
Free server included
safe-db-mcp is the free MIT-licensed connector for read-only MySQL and SQLite access, with query guards, row/time limits and local auditing. Its readable source is bundled with guided, hash-verified setup: no separate source download is needed for the included version.
Click here for safe-db-mcp, privacy documentation and the latest free source →
Analysis you can check
Safe DB Analyst turns a business question into schema inspection, a bounded query plan, reviewed relationship checks and a report linked to SQL evidence. It helps define periods, units and output grain, avoid double-counted totals, reconcile results and explain unavailable checks.
New strict result-privacy update
The updated package bundles safe-db-mcp 0.2.0 and mode-aware setup instructions. Enable strict mode with an owner-reviewed local policy: only approved reporting sources and classified fields can be queried. Public number ranges, enums and calendar months are validated; complete private cells are replaced with [REDACTED]. Ambiguous query shapes, unsupported values, budget excesses and audit failures block the whole response. Schema tools show policy metadata only.
Strict mode deliberately restricts ad hoc SQL: no aliases, expressions, joins, CTEs or aggregate functions. Precompute required joins/aggregates in DBA-reviewed reporting views. Existing reviewed-join workflows remain available in explicitly labelled legacy mode, with strict protection off; the skill never silently downgrades a protected connection.
The new runtime uses metadata-only audit and generic errors in both modes, excluding SQL/literals, row data and driver diagnostics. Earlier log entries are not migrated or deleted. There is no new credential store or reversible identity map. This is scoped result redaction, not general free-text entity anonymisation, whole-prompt protection, differential privacy or a compliance guarantee. Correct classifications and database-layer permissions remain essential; released results still enter your chosen model context.
Guided setup
The $19 one-time package adds the analysis workflow, readiness checker, references, examples and bundled setup convenience. The server remains free MIT software. Your agent verifies named files and assembles only the runtime into a new persistent folder you choose. The offline assembler does not install dependencies, retrieve passwords or connect a database. Dependency installation and client registration are separate authorized steps.
Requires Python 3.10+, uv, a local stdio-capable MCP client with terminal/file access and an authorized SQLite/MySQL database. Strict privacy also requires reviewed reporting views and a local policy. Keep MySQL passwords in the intended secure OS Keychain, outside chat/client JSON/policies. No hosting or subscription is included; remote-only clients cannot launch this server unchanged.
Walkthrough and verification
Watch the 45-second silent illustrated walkthrough →
The video uses fictional shop data and illustrates the original analysis workflow; it is not a recorded agent session or demonstration of the new strict mode. The sample report below is a legacy-mode example; strict mode uses approved precomputed sources instead.
The server passes 304 tests, including real SQLite and MCP stdio checks, and 46 existing attack/analytics evals with an unchanged fixture database. Package assembly and assembled-runtime tests are checked locally. Live buyer-side per-file delivery, named-client setup, Windows assembly and real MySQL integration remain unverified.
Requires the separately installed free safe-db-mcp server. Supports SQLite and MySQL through that server; local validation here used SQLite. Live Agensi delivery, named agent-client compatibility, MySQL integration and external-user evaluation remain unverified. Masking follows configured column names and does not discover all personal data. No PostgreSQL, database writes, hosted service, server installation or security/compliance guarantee. Query results enter your chosen agent/model context.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
Requires
Permissions
Terminal/files verify and assemble only named MIT runtime files into a new selected folder, install dependencies as authorized and prepare local MCP setup. Runtime reads named SAFE_DB_* settings and retrieves its MySQL password from the selected secure OS keyring in-process. Never enumerate ambient environment variables or inspect unrelated credentials. A selected local privacy policy contains classifications only. Released results enter the selected model context; new audit events contain metadata without SQL/literals or row values. Older logs are not migrated.