This MCP server has two tools with minimal but present descriptions and basic schemas. However, there are significant gaps: parameter descriptions are mostly missing or trivial, schemas lack proper type constraints, and the server lacks guidance on when to use each tool versus alternatives. The execute_query tool accepts arbitrary SQL, which creates security and reliability risks without input validation or error recovery guidance. Output schemas are not documented. The tool definitions are directly visible in server.js, so they are not inferred, but the quality is below community baseline.
execute_query tool accepts arbitrary SQL with no input validation, sanitization, or injection guards. No error recovery guidance. LLMs could pass malicious queries.
list_tables filter parameters (catalogName, schemaName, tableName) lack type definitions, all are strings with no validation. No explanation of what they filter or format constraints.
Tool descriptions are generic and under-informative. 'Execute SQL query on CData Connect Cloud' does not explain WHEN to use this vs list_tables, what risks exist (SQL injection, performance), or what the LLM should expect from results.
execute_querylist_tables
Recommendations
Add comprehensive output schemas for both tools. For execute_query, document the structure of recordset results (e.g., array of objects with column names as keys). For list_tables, document the INFORMATION_SCHEMA.TABLES columns returned (TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, etc.) and add a total_count field for pagination.
Enhance tool descriptions. For execute_query: 'Execute a SQL SELECT query against CData Connect Cloud. Returns query results as an array of objects. Supports standard SQL; avoid INSERT/UPDATE/DELETE. Use list_tables first to discover available tables. Timeout: 60s.' For list_tables: 'List tables in the connected database. Filter by catalog, schema, or table name. Returns up to 100 results; use pagination parameters (limit, offset) for larger result sets. Call this first to discover available tables before executing queries.'
Add parameter descriptions and type constraints. For list_tables: catalogName (string, optional, case-sensitive name of the database catalog to filter by), schemaName (string, optional, case-sensitive schema name to filter by), tableName (string, optional, case-sensitive table name to filter by). Add limit (integer, 1-1000, default 100) and offset (integer, default 0) for pagination.
Implement SQL injection prevention. Validate that execute_query contains only SELECT statements. Reject queries with DROP, DELETE, INSERT, UPDATE, or EXEC. Return a clear error: 'Only SELECT queries are allowed. Cannot execute DDL or DML statements.'
Add error categorization and recovery guidance. In CallToolRequestSchema handler, catch specific error types: timeout errors should suggest retrying with a smaller limit or longer timeout; permission errors should suggest checking CDATA_CONNECT_CLOUD_USER credentials; syntax errors should include the invalid query snippet and suggest using list_tables to verify table names.
No pagination support. A list_tables query could return hundreds of tables; no limit parameter or offset/cursor mechanism. Returns unbounded result sets that blow context windows.
execute_query takes a raw 'query' parameter with no description explaining format, dialect, constraints, or timeout behavior. LLMs have no guidance on what SQL dialect CData uses or what queries are safe.
Error handling in server.js catches exceptions but does not categorize them (retryable vs fatal) or provide recovery guidance. LLMs get raw stack traces instead of actionable next steps.
No tool annotations (readOnlyHint, idempotentHint). While both tools appear read-only, declaring this via annotations lets clients surface that metadata and warn users if needed.
Credentials (CDATA_CONNECT_CLOUD_USER, CDATA_CONNECT_CLOUD_PAT) are injected via environment variables, which is correct. However, no audit logging or permission gates documented. No scopes declared.
execute_querylist_tables
Add tool annotations. Register execute_query and list_tables with readOnlyHint: true to signal they do not modify state. For list_tables, add idempotentHint: true.
Declare tool scopes. Add metadata indicating both tools require 'read:database' scope. Log calls with caller identity, query text, timestamp, and result row count for audit compliance.
Reduce result verbosity. For execute_query, cap results at 500 rows and return a 'truncated' flag if more exist. For list_tables, cap at 100 results by default and return total_count and next_offset to guide pagination.
Add query timeout and size limits to tool descriptions. State that queries must complete within 60s and return max 500 rows; larger queries will be rejected with 'Query timeout or result set too large' error.