Skip to main content
Glama
Chetto983

Mathematical Calculator MCP Server

by Chetto983

differentiate

Computes the derivative of a mathematical expression with respect to a variable. Supports polynomials, trig, exponential, and logarithmic functions.

Instructions

Computes the derivative of a mathematical expression with respect to a variable.

Supports polynomials, trigonometric functions, exponential functions, logarithms, and other functions supported by SymPy.

Args: expression: The mathematical expression to differentiate as a string. Examples: "x**2", "sin(x)", "exp(x)", "log(x)" variable: The variable with respect to which to differentiate. Default is "x". Optionally, other variables can be specified.

Returns: On success: {"result": } On error: {"error": }

Examples: >>> differentiate("x**2") {'result': '2x'} >>> differentiate("sin(x)") {'result': 'cos(x)'} >>> differentiate("xy", "y") {'result': 'x'} >>> differentiate("exp(x)") {'result': 'exp(x)'}

Notes: - Use mathematical notation with explicit operators (* for multiplication) - Powers can be represented with ** or ^ (e.g., x**2 or x^2) - For trigonometric functions, use sin(x), cos(x), etc. - Only support for one variable at a time (implicit differentiation not supported)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variableNox
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the return contract for both success ({"result": ...}) and error ({"error": ...}) cases, lists supported function families, and states a hard limitation on implicit differentiation. This is solid behavioral disclosure for a pure computation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, then Args/Returns/Examples/Notes. The four doctest examples are genuinely useful for showcasing notation, though the section headers add modest overhead. Every part mostly earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description documents the return shape explicitly for both success and error paths, plus supported operations and syntax conventions. Nothing an agent needs to call differentiate correctly is left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully. It explains 'expression' with concrete examples ('x**2', 'sin(x)', 'exp(x)') and the notation rules (*, ** or ^), and explains 'variable' including its default of 'x' and that other variables can be supplied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Computes the derivative') and resource ('mathematical expression with respect to a variable'), and the scope (supported function families) sets it apart from siblings like integrate, expand, and factorize. An agent can immediately distinguish it from the other math tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly states the context of use and an explicit exclusion ('Only support for one variable at a time / implicit differentiation not supported'). It doesn't name the natural alternative (integrate) to route the agent, but the domain is well bounded.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.