Skip to main content
Glama

Molar mass

molar_mass
Read-only

Parse a chemical formula to calculate molar mass in g/mol and each element's mass contribution, including brackets and hydrates such as CuSO4.5H2O.

Instructions

Parse a chemical formula and return the molar mass in g/mol with the mass each element adds. Handles brackets and hydrates like CuSO4.5H2O.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "formula": "<formula>"
    },
    "name": "molar_mass"
  }
}

Input Schema

NameRequiredDescriptionDefault
formulaYesChemical formula like H2O, Ca(OH)2 or CuSO4.5H2O. Write each element with a capital first letter.

Output Schema

NameRequiredDescriptionDefault
massYes
breakdownYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safe, deterministic nature of the call is clear. The description adds capability coverage (brackets and hydrate notation such as CuSO4.5H2O), but says nothing about error behavior for an invalid formula or the precision of the result.

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

Conciseness5/5

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

Two tight sentences: the return contract is front-loaded and the capability caveat follows. Every clause carries information and nothing is padded.

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?

An output schema exists, and the description covers the key input edge cases (brackets, hydrates), so an agent has what it needs to call it correctly. The only real gap is undefined behavior on malformed formulas, which is minor for a pure calculation tool.

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

Parameters3/5

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

With one parameter at 100% schema description coverage, the baseline is 3. The description's mention of brackets and hydrates largely restates examples the schema already provides (Ca(OH)2, CuSO4.5H2O), adding no formatting rule such as capitalization or spacing beyond what is documented.

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 names a specific verb ("parse") and resource ("chemical formula") and states the return value (molar mass in g/mol plus per-element contribution). It is unambiguous, though it never explicitly distinguishes itself from siblings like balance_equation or stoichiometry.

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?

Usage is only implied: the definition shows supported formula forms (brackets, hydrates like CuSO4.5H2O), which suggests when the tool applies. There is no explicit when-to-use/when-not guidance and no routing to or away from the sibling chemistry tools.

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