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
service_versionYesDeployed Calcgrid implementation version used for the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / service_version
      Added value: +{
      +  "description": "Deployed Calcgrid implementation version used for the result.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "request",
      -  "result",
      -  "timestamp"
      -]New value: +[
      +  "success",
      +  "service_version",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "formula": "C6H12O6"
      +  },
      +  {
      +    "formula": "CuSO4·5H2O"
      +  }
      +]
  3. Added
  4. Removed
  5. 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 readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds meaningful behavior beyond annotations: it parses brackets, nested groups, hydrates, ignores trailing charges/states, uses IUPAC 2021 atomic weights, and explains what outputs are produced. No contradiction exists.

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 well-structured and front-loaded with the core usage rule, then computation details, inputs, outputs, formula, and REST fallback. Each section earns its place, though the redundant formula examples and repeated 'formula (string)' could have been trimmed slightly.

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?

The description is complete for this tool's complexity: it covers when to use it, what it computes, supported formula syntax, output names, the calculation formula, and a direct REST fallback with an explicit endpoint. The presence of an output schema means return values need not be fully described, but the description goes beyond that anyway.

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 description coverage is 100%, and the schema itself thoroughly documents the formula parameter with examples and edge-case handling (case-sensitive symbols, brackets, hydrates, ignored charges). The description only repeats 'formula (string)' and adds no new parameter-level semantics, so the baseline of 3 is appropriate.

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?

The description states a clear verb+resource: given a chemical formula, compute molar mass, atom counts, and mass-percent composition. It distinguishes this tool from moles-mass conversion and molarity calculation, and it is not confused with the dozens of other calculator siblings.

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?

It explicitly says when to use the tool ('Use this when you have a chemical formula and need its molar mass...') and when not to use it, naming alternatives (moles-mass, molarity). It also instructs the agent to call the tool directly rather than answering from memory, which is strong usage guidance.

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