MCP Server for Hero's Journey SQL Assistant. Exposes database querying capabilities via Model Context Protocol. Returns results as text tables. Supports natural language queries in Russian or English against a PostgreSQL database containing user subscriptions, marathon participation, bookings, payments, and notifications.
This MCP server exposes 3 database query tools with reasonable but incomplete documentation. Tool names follow verb_noun convention (query_database, execute_sql, get_schema_info), which is positive. However, critical gaps exist: (1) No input schemas are fully visible in the provided source code excerpt, the `get_schema_info` tool's inputSchema is incomplete (missing 'required' array and no type constraints on table_name). (2) Descriptions are present and moderately detailed (150-200 chars each), exceeding the 10-char minimum, but lack LLM-optimized guidance on error recovery and when to call each tool vs. the others. (3) Parameter descriptions exist but are sparse, 'table_name' in get_schema_info lacks type info (is it a string? enum of valid table names?). (4) Output schemas are not documented, callers do not know what structure query_database or execute_sql returns (e.g., are results a JSON object, a text table string, a CSV?). The code shows results are formatted as text tables, but this is not declared in the tool schema. (5) Security: the server accepts arbitrary SQL in execute_sql with only a surface 'must start with SELECT' check, no mention of injection prevention or schema/table whitelisting. (6) Error handling is minimal, the tool call handler catches exceptions generically and returns an error string, but does not guide LLMs on recovery (retryable vs. fatal).
Execute a specific SQL SELECT query against Hero's Journey database. Use this when you already have a SQL query and want to execute it directly. Only SELECT queries are allowed. The query must use ods_core, stage, or ris schema prefix for tables. Returns query results as formatted text table. Note: For Excel exports, use the Slack bot instead.
Get information about available database tables and their structure. Returns documentation about: - Available tables in the database - Column names and types - Business terms and their meanings - Relationships between tables Use this to understand what data is available before querying.
Query the Hero's Journey database using natural language. This tool accepts questions in Russian or English and: 1. Generates optimized SQL query 2. Executes query against PostgreSQL database 3. Returns results as formatted text table (fast and efficient) Available data: - User subscriptions (heropass) - Marathon participation (usermarathonevent) - Bookings and check-ins - Payments - Notifications Examples: - "Show users whose subscription expires in the next 7 days" - "How many users completed Hero's Week marathon?" - "List all payments for Burn I program" Note: For Excel exports, use the Slack bot instead.
Output schemas are not documented. Tools return text-formatted results (per code: 'formatted text table'), but the tool definitions do not declare return types or structure. LLMs cannot plan follow-up calls or extract fields without documented output schema.
get_schema_info inputSchema is incomplete. The inputSchema object lacks a 'required' array, and 'table_name' has no type constraint (string? enum?). Per the rubric, missing type definitions cap schema score at 30.
execute_sql accepts arbitrary user-supplied SQL with minimal validation ('must start with SELECT'). No evidence of SQL injection prevention, table/schema whitelisting, or prepared statements. This is a critical security and correctness gap.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 56 | <=2025-11-25 | v2 |
| 2026-03-09 | D | 50 | - | v1 |
Error handling provides no guidance to LLMs. Generic exception catches return 'Error: {str(e)}' with no categorization (retryable vs. fatal) or recovery suggestions. LLMs cannot intelligently retry or ask the user for clarification.
Tool descriptions lack differentiation guidance. Descriptions do not explain WHEN to call query_database vs. execute_sql, both query the same database. LLMs will waste reasoning cycles deciding between them.
Parameter descriptions are incomplete. 'question' in query_database lacks guidance on multi-language support or query complexity limits. 'sql' in execute_sql does not document allowed schemas (mentions 'ods_core, stage, or ris' in description but should be enforced as a constraint).