MCP server for AI for Database — query any database in plain English, run safe read-only SQL, set up database alerts, and check dashboards through the aifordatabase.com REST API.
Server has 6 tools with complete input schemas and descriptions. Naming follows verb_noun convention (list_, get_, run_, ask, create_). Descriptions are detailed (100-250 chars) and explain WHEN to use each tool. However, output schemas are NOT documented, LLMs cannot predict response structure. Error handling is present but generic (AfdApiError wrapping). No tool annotations (readOnlyHint/destructiveHint). Parameters lack format constraints (e.g., cron expression for triggerConfig is described as JSON string but not validated). create_workflow has complex nested objects (steps, actions) with minimal per-field documentation.
Ask a question about a database in plain English. The API's own agent translates it to SQL, runs it, and returns the answer (content), the SQL used (sqlQuery), and the results (queryResult). For follow-up questions, pass the conversationId from the previous response. Consumes AI credits — for repeated/known queries prefer run_query.
Create a workflow: SQL steps + EMAIL/WEBHOOK actions, run manually or on a cron schedule. To make an alert, write a step query that only returns rows when the condition fires and set stopIfEmpty=true — actions then run only when rows come back. Step results are auto-appended to the email/webhook payload. Point a WEBHOOK at a Slack incoming-webhook URL for Slack alerts. Free plan allows 3 workflows.
Get the cached schema (tables, columns, relationships) of a database connection. Call this once before writing SQL — no discovery queries needed.
List the database connections available to this API key. Returns id, name, type (POSTGRES/MYSQL/MARIADB/MSSQL/MONGODB/SQLITE), host, database, isActive. Use the returned id as connectionId in other tools.
List workflows (scheduled database alerts / reports). Returns each workflow with its trigger type and step/action counts.
Output schemas not documented. LLMs cannot predict response structure (columns, rows, rowCount for run_query; content, sqlQuery, queryResult for ask; etc.). Forces agents to guess field names and types.
create_workflow has deeply nested input (steps array with query/stopIfEmpty; actions array with type/config objects). Nested config objects lack per-field descriptions. LLMs cannot infer EMAIL config structure ({to, subject, body}) vs WEBHOOK config ({url, method, headers, body}).
No tool annotations (readOnlyHint, destructiveHint, idempotentHint). create_workflow is destructive (WRITE risk) but not marked. Agents cannot distinguish safe vs risky tools without reading descriptions.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 53 | 2026-07-28+ | v2 |
Run a SQL query directly against a database connection. Deterministic, no AI in the loop, no credits consumed. Returns columns, rows, rowCount, executionTime. On a SQL error the database's own message is returned — fix the SQL and retry. Rows cap at 500, so aggregate in SQL rather than pulling raw tables.
triggerConfig parameter accepts 'JSON string with a cron expression' but no validation or format constraint. LLMs may pass invalid JSON or non-cron strings. Should validate server-side and return actionable error.
Error handling returns AfdApiError with messages but no recovery guidance. E.g., 402 Payment Required says 'use run_query' but doesn't explain how to check remaining credits or upgrade. Agents cannot self-correct.