MCP server for executing SQL queries in Google BigQuery and returning results
Single tool 'run_query' has critical gaps in definition quality. The tool name lacks proper verb-noun structure (should be 'execute_query' or 'query_bigquery'). The description (53 chars) is below the minimum threshold and provides minimal context about when/why to use the tool. Most critically, the input schema lacks any parameter-level descriptions, the 'sql' parameter has a description in the schema, but there are zero constraints, no format guidance, and no validation hints. The tool returns unstructured text rather than structured JSON with typed fields. No error handling guidance exists. The implementation exposes direct SQL execution without any input sanitization or SQL injection prevention, which is a critical security issue for an agent tool that accepts arbitrary SQL. Output is capped at 5 rows but this limit is not documented in the tool description.
Execute a SQL query in Google BigQuery and return first 5 rows as text.
Tool name 'run_query' lacks action verb clarity and specificity. Should be 'execute_query' or 'query_bigquery' to clearly signal the action and distinguish from similar tools.
Tool description (53 chars) is below baseline minimum (p10=34 chars is acceptable but this lacks essential context). Missing: WHEN to use it, prerequisites (e.g. require Google Cloud credentials/project), and WHAT it returns (mentions '5 rows' but not structure). Description should be 100-250 chars with explicit guidance.
Input schema 'sql' parameter has description but lacks critical constraints: no format specification, no length limits, no guidance on BigQuery SQL dialect. LLMs cannot infer what constitutes valid SQL without explicit format/example guidance or validation rules.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 30 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 5 | - | v1 |
Tool returns unstructured plain text instead of structured JSON. Response format 'Sample result:\n{preview}' forces the LLM to parse free-text output, which is error-prone and wastes tokens. Should return {success: bool, rows: [{col: val, ...}], total_count: int, query_status: string}.
No error handling guidance. If query fails, BigQuery client raises an exception but tool does not catch it or provide recovery hints. Should return {success: false, error: 'Invalid query syntax', suggestion: 'Check column names or use EXCEPT/INTERSECT'}. Agent has no way to self-correct.
CRITICAL SECURITY: Tool accepts arbitrary SQL without any sanitization or SQL injection prevention. An agent or adversary could pass malicious SQL like 'SELECT * FROM sensitive_table; DROP TABLE critical_data; --'. No input validation, no query analysis, no safelist. This is unacceptable for production.
No tool annotations present. Tool should declare 'readOnlyHint: true' to signal it does not modify state (safe to retry). Missing tool annotations prevent agents from understanding side effects.
Result limit of 5 rows is undocumented. Tool description does not mention pagination, offset, or limit parameters. Agents cannot request more rows if needed. Should either accept limit/offset parameters or document the hard limit clearly.
No BigQuery project/dataset context declared. Tool does not accept or document which BigQuery project the SQL will execute against. Credentials appear to come from environment (google.cloud.bigquery.Client()), but this is opaque to the agent. Should accept optional project_id parameter or document the expected environment setup.