A spreadsheet query and formula generation service that processes natural language queries against table data and generates Excel formulas
This MCP server has one tool, query_spreadsheet, with severely deficient definition quality. The tool name follows basic verb_noun convention (query_spreadsheet), but the implementation reveals fundamental design flaws: (1) The input schema is incomplete, table_data is typed as 'list' without specifying list item structure (should be array of objects with explicit properties). (2) The description is generic and does not explain WHEN to use this tool versus alternatives, WHAT the natural language query syntax accepts, or HOW it handles complex filters. (3) No output schema is documented, the response structure (filtered_rows, generated_formula, summary_stats) is inferred from code, not declared. (4) The implementation shows critical algorithmic issues: the string matching logic ('if any(str(val).lower() in q or q in str(val).lower())') is naive substring matching, not natural language understanding, misleading given the tool claims to 'process natural language queries'. (5) The fallback behavior ('if not filtered: filtered = table_data[:2]') silently returns unrelated rows without error, hiding failures. (6) The generated formula is hardcoded (SUMIFS) and syntactically broken, it interpolates raw user input without escaping, risking formula injection. (7) The confidence score (0.95) is always constant, not computed, meaningless to agents. (8) No error handling: malformed queries, empty inputs, or non-dict rows will crash silently or return wrong results.
Processes a natural language query against table data and returns filtered rows matching the query along with a generated Excel formula and summary statistics
Input schema lacks structure specification. 'table_data' is typed 'list' with no declaration of list item structure (should define that items are objects with string keys). This forces LLMs to guess whether rows are dicts, tuples, or nested structures.
No output schema is documented. Response structure (filtered_rows array, generated_formula string, summary_stats object with total_matched and confidence fields) is visible only in code, not in tool definition. LLMs cannot plan downstream data extraction.
Tool description is generic (59 chars). Does not explain: (1) What natural language syntax the query accepts (keywords, boolean operators, comparisons?). (2) How filtering works (exact match, substring, fuzzy?). (3) When this tool should be selected over alternatives. (4) What the generated formula represents or how to use it.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 21 | 2026-07-28+ | v2 |
Implementation logic contradicts the tool name and description. Tool claims to 'process natural language query' but uses naive substring matching (if any(str(val).lower() in q...)). This is not NLP, it is case-insensitive substring search. For 'Active enterprise plans', it will match any row containing 'active' or 'enterprise' as substrings, not filter by status=Active AND category=Enterprise. LLM expects semantic query understanding but gets pattern matching.
Silent fallback on empty results. When no rows match, code returns 'filtered = table_data[:2]' (first 2 rows) without error or warning. This hides query failures and returns irrelevant data. An LLM cannot distinguish between 'no matches found' and 'first 2 rows happened to match'.
Generated formula is hardcoded and broken. Code produces '=SUMIFS(C2:C100, A2:A100, "' + raw_query + '")' without escaping or validation. This is formula injection risk: a query like 'test"); DELETE FROM users; //' would corrupt the formula. Also, hardcoding SUMIFS ignores the actual filter intent, why SUMIFS for a 'query' that could ask for counts, averages, or custom filters?
Parameters lack description text. 'table_data' and 'natural_query' have brief type labels but no actionable description. 'table_data: list' does not tell an LLM whether items are dicts, whether keys can be arbitrary strings, or whether values must be serializable.
Constant confidence score (0.95) is not computed. Tool always returns confidence: 0.95 regardless of query quality, match count, or algorithm uncertainty. An LLM relying on this field for decision-making will be misled. Confidence should reflect actual match quality (e.g., 0.3 if only 1 row matched; 0.9 if 10+ rows matched with high similarity).
No error handling for malformed input. If table_data is not a list, or rows are not dicts, or natural_query is not a string, the code will crash. No try/catch, no validation, no error message. An LLM cannot recover from these failures.
No pagination or result limits. If table_data contains 10,000 rows and a query matches 9,000, all 9,000 are returned in filtered_rows. This will blow the context window. Tool should accept limit and offset parameters and return a total_count.
Tool name is ambiguous. 'query_spreadsheet' does not clarify the action: does it RETRIEVE data? FILTER data? ANALYZE data? GENERATE formulas? More specific names like 'filter_spreadsheet_rows' or 'search_spreadsheet_data' would reduce LLM confusion about intent.