Enhanced MCP PostgreSQL Server with OpenAI GPT-4o-mini integration for Natural Language to SQL Query Interface
Server has 4 tools with basic schemas and descriptions, but significant quality gaps. Tool names lack clear action verbs (natural_language_query is vague; execute_sql is generic). Descriptions are present but brief (avg ~80 chars, below 194-char baseline). Parameter descriptions are minimal or absent. No output schemas documented. No error handling guidance. No tool annotations. Security concerns: execute_sql accepts arbitrary SQL with minimal validation. Missing pagination, result limits, and structured output guidance.
Execute raw SQL query against PostgreSQL database
Get database schema information
Execute natural language queries against PostgreSQL database using AI interpretation
Validate SQL query using AI without executing it
execute_sql tool accepts arbitrary SQL with only basic safety check (_is_safe_query). No input validation, no parameterized queries, no rate limiting. High SQL injection and data destruction risk.
No output schemas documented for any tool. LLMs cannot plan downstream calls or extract structured data. Responses are JSON strings, not typed objects.
Tool names lack clear action verbs. 'natural_language_query' is vague (query what? how?). 'execute_sql' is generic. Should be 'convert_nl_to_sql_and_execute' or split into separate tools.
Parameter descriptions are minimal or missing. 'query' param in natural_language_query has description but no format guidance. 'table_name' in get_schema has no description at all.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 38 | <=2025-11-25 | v2 |
No error handling guidance. Errors return raw exception messages (e.g., 'Error: {str(e)}'). LLMs cannot determine if errors are retryable, user-fixable, or fatal.