Skip to main content
Glama
laszlopere

mcp-molecules

molecular_weight_calculator

Compute the molecular weight, average mass, or monoisotopic mass of a chemical formula using NIST atomic weights. Optionally propagate uncertainties and report percent composition by mass.

Instructions

Compute the molecular weight (molar mass) of a chemical formula.

Parses formula into an atom tally, looks up each element's mass in the bundled NIST Atomic Weights and Isotopic Compositions database, and returns the total weight in the requested unit. Every call reports all three distinct mass flavors under masses so callers never conflate them or have to re-ask:

  • nominal -- sum of the integer mass numbers of the most abundant isotopes,

  • average -- the standard atomic weight (average molar mass),

  • monoisotopic -- the exact mass of the most abundant isotopes.

The monoisotopic flag selects which of these is mirrored at the top level (weight / uncertainty / formatted) and named by primary. Optionally propagates NIST uncertainties (uncertainty) and/or reports percent composition by mass (composition).

Raises ValueError for an unparseable formula or an unknown element.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formulaYesChemical formula to weigh. Supports element symbols, integer multipliers, arbitrarily nested parenthetical groups, and isotope labels D (deuterium) and T (tritium). Examples: 'H2O', 'C6H12O6', 'Ca(OH)2', 'Fe2(SO4)3', '((CH3)2CH)2', 'D2O', 'Tc'.
unitNoOutput unit for the reported mass. Defaults to grams per mole.g/mol
uncertaintyNoIf true, propagate the per-element NIST standard uncertainties in quadrature and report the result as value ± sigma.
monoisotopicNoSelects which mass flavor is reported at the top level (weight / uncertainty / formatted): false (default) for the standard atomic weight, true for the monoisotopic mass. All three flavors (nominal, average, monoisotopic) are always returned under 'masses' regardless of this flag.
compositionNoIf true, return the per-element percent composition by mass (count, mass subtotal, and percentage) alongside the total weight.
Behavior4/5

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

With no annotations provided, the description effectively discloses all key behaviors: parsing formula, looking up NIST data, returning three mass flavors, and raising ValueError for invalid inputs. It does not mention performance or side effects, but for a read-only calculator this is sufficient.

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?

The description is well-structured, front-loaded with the primary purpose, and uses a bullet-like list for the mass flavors. Every sentence adds value, and the length is appropriate for the tool's complexity, achieving high information density without redundancy.

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?

Despite lacking an output schema, the description thoroughly covers input parameters, output structure (three masses, top-level weight, uncertainty, composition), and error handling. It provides all necessary context for an agent to correctly invoke and interpret results.

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

Parameters5/5

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

Schema description coverage is 100%, providing baseline parameter documentation. The description adds significant value beyond the schema by explaining the three mass flavors, the role of the monoisotopic flag, uncertainty propagation, and composition reporting, thus enriching the agent's understanding of parameter interactions.

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 clearly states it computes molecular weight (molar mass) from a chemical formula, using a specific verb and resource. It distinguishes itself from sibling tools like isotope_distribution by focusing on bulk mass calculation rather than isotopic patterns.

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

Usage Guidelines4/5

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

The description implies usage for molecular weight queries through the first sentence, but does not explicitly guide when to use this tool over siblings like find_chemical_compound or isotope_distribution. It provides clear context but lacks exclusions or alternative recommendations.

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

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/laszlopere/mcp-molecules'

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