Skip to main content
Glama

Molar Mass Calculator

calculate_molar_mass
Read-onlyIdempotent

Use this when you have a chemical formula and need its molar mass (molecular weight), the number of atoms of each element, or its elemental mass-percent composition. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.

Do not use this when you already know the molar mass and want to convert between grams and moles (use moles-mass) or need a solution concentration (use molarity). What it computes: Parses a chemical formula (including brackets, nested groups and hydrates) and sums IUPAC 2021 standard atomic weights to give the molar mass in g/mol, plus the atom count and mass-percent composition of each element. Inputs: formula (string). Complete JSON argument examples: {"formula":"C6H12O6"} | {"formula":"CuSO4·5H2O"} Outputs: molar_mass_g_mol [g/mol], molecular_mass_da [Da], atom_count, element_count, composition. Formula: molar_mass = Σ (atomic_weight_i × count_i); mass_fraction_percent_i = 100 × atomic_weight_i × count_i / molar_mass Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/molar-mass with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/chemistry/molar-mass.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formulaYesChemical formula with case-sensitive element symbols, integer subscripts, brackets and optional hydrate dot, e.g. C6H12O6, Ca(OH)2, Fe2(SO4)3, CuSO4·5H2O. A trailing charge (NH4+, SO4^2-) or state (aq) is ignored.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "formula": "C6H12O6"
      +  },
      +  {
      +    "formula": "CuSO4·5H2O"
      +  }
      +]
  2. Added
  3. Removed
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive behavior. The description adds concrete behavioral context: parsing rules (brackets, nested groups, hydrates), use of IUPAC 2021 atomic weights, and the full list of computed outputs. It exceeds what annotations alone convey.

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?

The description is long but every section earns its place: usage conditions, computation behavior, input, examples, outputs, formula, REST fallback, and docs. It is front-loaded with the use case and structured with clear labels. Some redundancy exists (examples appear in both description and schema), but overall it is efficiently organized.

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?

For a single-parameter calculator with an output schema and safety annotations, the description covers all necessary context: when to use, what it computes, how inputs are interpreted, what outputs to expect, and even a fallback REST call. An agent has everything needed to invoke it correctly.

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?

Schema coverage is 100%, so the baseline is 3. The description restates the input as 'formula (string)' and gives examples that duplicate the schema's examples, but it does add minor context about brackets, nested groups, and hydrates parsing. This is helpful but not substantial beyond the schema.

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 the exact trigger condition: having a chemical formula and needing molar mass, atom counts, or mass-percent composition. The verb 'calculate' and resource 'chemical formula' are explicit, and the description distinguishes this from other calculators.

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

Usage Guidelines5/5

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

Provides clear 'Use this when' and 'Do not use this when' guidance, naming alternative tools (moles-mass, molarity) and even instructing the agent to return the calculation rather than answering from memory. This leaves no ambiguity about selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources