Skip to main content
Glama
sdiehl
by sdiehl

quantity_simplify_units

Simplify quantities with units by converting to standard forms using SymPy. Ideal for physics and engineering expressions involving SI units, mixed units, and constants like speed of light.

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

TableJSON Schema
NameRequiredDescriptionDefault
expr_keyYes
unit_systemNo
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains that the tool uses sympy's simplify method for Quantity objects and returns a key for the simplified expression or an error message, which covers basic behavior. However, it lacks details on potential side effects, error conditions, or performance considerations, leaving gaps in transparency for a tool that modifies expressions.

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

Conciseness3/5

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

The description is front-loaded with the core purpose but includes extensive examples and a list of available units that may be redundant or overly detailed. While informative, the length could be streamlined by focusing more on essential guidance rather than exhaustive unit listings, affecting efficiency.

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

Completeness4/5

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

Given the complexity of unit simplification, no annotations, and no output schema, the description provides a solid foundation with purpose, parameters, examples, and return information. It covers key aspects like method (sympy), parameter semantics, and usage scenarios, though it could benefit from more explicit behavioral details or error handling to be fully comprehensive.

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

Parameters4/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains 'expr_key' as 'the key of the expression (previously introduced) to simplify' and notes that 'unit_system' is 'optional' and 'not used with direct simplify method,' clarifying parameter roles. The examples further illustrate usage, compensating well for the schema's lack of descriptions.

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

Purpose4/5

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

The description clearly states the tool 'simplifies a quantity with units using sympy's built-in simplify method for Quantity objects,' specifying the action (simplify), resource (quantity with units), and method (sympy). It distinguishes from sibling tools like 'simplify_expression' by focusing on unit simplification rather than general expression simplification. However, it doesn't explicitly contrast with 'convert_to_units,' which handles unit conversion rather than simplification.

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

Usage Guidelines3/5

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

The description implies usage through examples, such as simplifying force expressed in base units or electrical power expressions, but lacks explicit guidance on when to use this tool versus alternatives like 'simplify_expression' or 'convert_to_units.' It mentions that 'unit_system' is 'not used with direct simplify method,' which provides some context but doesn't fully define when this tool is appropriate compared to siblings.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

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