MCP server providing calculator tools with basic arithmetic, statistical, and calculus functions
Calculator MCP server demonstrates solid fundamentals with clear tool naming, consistent descriptions, and explicit schemas for all 12 tools. All tools follow verb_noun naming convention (add, subtract, multiply, etc.). Descriptions are present and actionable (average ~80 chars). Input schemas are properly typed with float/string/list types and parameter descriptions. However, the server has notable gaps: no output schemas documented, missing error handling guidance, no tool annotations (readOnlyHint/idempotentHint despite all tools being read-only), and security concerns around the evaluate/integrate/differentiate tools that accept arbitrary expressions via eval(). Tool composition is sound (each tool does one thing), but documentation could better explain when to use mean vs median vs mode, and the security warning in evaluate's description is present but could be more prominent.
Add two numbers.
Numerically differentiates an expression string (func of 'x') at a point. E.g., expression='x**2', point=2.
Divide a by b. Raises error on division by zero.
Evaluates a mathematical expression string (e.g., '(2+3)*4'). Supports PEMDAS/BODMAS. WARNING: Uses eval(), ensure input is trusted.
Numerically integrates an expression string (func of 'x') over an interval [a, b]. E.g., expression='x**2', a=0, b=1.
Calculates the mean (average) of a list of numbers.
Calculates the median of a list of numbers.
Missing output schemas: No tool explicitly documents return types or output structure. LLMs cannot plan downstream operations or extract return values with confidence.
Security concern: evaluate, integrate, and differentiate accept arbitrary string expressions and use eval(). While there is a warning in evaluate's docstring, the risk is not clearly propagated to all three tools, and no input validation/sanitization is visible in the source.
No tool annotations: All 12 tools are READ_ONLY operations, but the server does not use readOnlyHint or idempotentHint annotations in the tool definitions. This metadata is critical for agent planning and prevents unintended state mutations.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 66 | <=2025-11-25 | v2 |
| 2026-03-09 | C | 68 | - | v1 |
Calculates the mode(s) of a list of numbers. Returns a list of modes.
Multiply two numbers.
Calculates the sample standard deviation of a list of numbers (ddof=1).
Subtract b from a.
Calculates the sample variance of a list of numbers (ddof=1).
Error handling lacks recovery guidance: Exceptions are caught and logged in most tools (e.g., mean, median, std_dev) but re-raised without actionable context for the LLM. No differentiation between retryable, user-fixable, and fatal errors.
Statistical tool descriptions could be better disambiguated: mean, median, and mode all compute central tendency but serve different use cases. Descriptions should explain when to use each (e.g., 'Use mean for typical values; median for skewed distributions with outliers; mode for categorical/discrete data').
Parameter validation rules not explicit in descriptions: Parameters like ddof in std_dev and variance accept integers but no description specifies the valid range. What happens if ddof > len(data)? Is there a minimum value?