Symbolic Algebra MCP Server

by sdiehl

quantity_simplify_units

Simplify quantities with units by converting them to their most reduced or standard form using SymPy’s simplify method. Supports SI, cgs, and natural unit systems for expressions involving length, mass, energy, force, and more.

Instructions

Simplifies a quantity with units using sympy's built-in simplify method for Quantity objects.

Args: expr_key: The key of the expression (previously introduced) to simplify. unit_system: Optional unit system (from UnitSystem enum). Not used with direct simplify method. The following units are available by default: SI base units: meter, second, kilogram, ampere, kelvin, mole, candela Length: kilometer, millimeter Mass: gram Energy: joule Force: newton Pressure: pascal Power: watt Electric: coulomb, volt, ohm, farad, henry Constants: speed_of_light, gravitational_constant, planck Example: # Simplify force expressed in base units expr_key = introduce_expression("kilogram*meter/second**2") result = quantity_simplify_units(expr_key) # Returns newton (as N = kg·m/s²) # Simplify a complex expression with mixed units expr_key = introduce_expression("joule/(kilogram*meter**2/second**2)") result = quantity_simplify_units(expr_key) # Returns a dimensionless quantity (1) # Simplify electrical power expression expr_key = introduce_expression("volt*ampere") result = quantity_simplify_units(expr_key) # Returns watt Example with Speed of Light: # Introduce the speed of light c_key = introduce_expression("speed_of_light") # Convert to kilometers per hour km_per_hour_key = convert_to_units(c_key, ["kilometer", "1/hour"]) # Simplify to get the numerical value simplified_key = quantity_simplify_units(km_per_hour_key) # Print the result print_latex_expression(simplified_key) # Shows the numeric value of speed of light in km/h Returns: A key for the simplified expression, or an error message.

Input Schema

NameRequiredDescriptionDefault
expr_keyYes
unit_systemNo

Input Schema (JSON Schema)

{ "$defs": { "UnitSystem": { "enum": [ "MKS", "MKSA", "natural", "SI", "cgs" ], "title": "UnitSystem", "type": "string" } }, "properties": { "expr_key": { "title": "Expr Key", "type": "string" }, "unit_system": { "anyOf": [ { "$ref": "#/$defs/UnitSystem" }, { "type": "null" } ], "default": null } }, "required": [ "expr_key" ], "title": "quantity_simplify_unitsArguments", "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sdiehl/sympy-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server