An MCP server that provides PostgreSQL query execution capabilities for AI agents, integrated with Azure AI Projects and a Flask chat application frontend.
Single tool 'query_postgres' has a basic description but critical gaps in schema documentation, parameter descriptions, and error handling. The tool accepts arbitrary SQL strings with no input validation, poses SQL injection risks, and lacks output schema documentation. Description is minimal (67 chars) and does not explain when to use the tool, what it returns, or prerequisites. No parameter description for the 'query' field itself. Error handling returns raw exception strings to the LLM, providing no recovery guidance.
Expects JSON of the form {"query": "..."}. Returns {"rows": [...]} with all non‑JSON types converted.
No input parameter description. The 'query' parameter has a type ('string') but no description explaining what SQL is valid, constraints, or format expectations. LLMs cannot infer whether to pass SELECT-only queries or any SQL.
No output schema documented. The tool description states it returns '{"rows": [...]}' but does not specify the structure of each row, data types, or field names. LLMs cannot plan downstream operations without knowing what fields are available.
SQL injection vulnerability. Tool accepts arbitrary SQL strings with no sanitization or validation. An LLM can be tricked via prompt injection into passing malicious payloads (e.g., 'DROP TABLE users;'). No input validation, no prepared statements visible.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 32 | 2026-07-28+ | v2 |
Error responses expose raw exception strings. When an error occurs, the tool returns '{"error": str(e)}', which may leak database internals, connection details, or stack traces to the LLM. No error classification (retryable vs. fatal) or recovery guidance.
No pagination or result limits. Tool fetches all rows from a query with no limit, offset, or cursor support. A SELECT * on a large table could return thousands of rows, exhausting context windows and degrading LLM reasoning.