Skip to main content
Glama

WritersLogic business agents

formula-weight

Formula weight from a chemical formula (Hill notation, IUPAC/CIAAW weights) — Parses a chemical formula (parentheses, brackets, hydrate dots such as CuSO4·5H2O, an ignored charge) for a chemist or an agent that must check a molar mass, and returns the Hill-notation formula, the formula weight in g/mol from the CIAAW abridged standard atomic weights summed exactly in decimal arithmetic, and mass fractions. Pass claimedWeight and tolerance to check a stated molar mass. Elemen

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "formula-weight"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoformula (default) computes the weight; smiles validates syntax only.
smilesNoA single SMILES string without a name, at most 200 characters (mode smiles).
formulaNoChemical formula, at most 200 characters. Element symbols are case-sensitive (Co is cobalt, CO is carbon monoxide). Hydrate separators: . · • *. A trailing charge such as ^2+, 2- after a bracket, or a bare + or - is ignored.
toleranceNoAllowed absolute difference from claimedWeight in g/mol. Default 0.01.
claimedWeightNoStated molar mass to check, g/mol.
elementWeightsNoCaller-chosen weights; they take precedence over the table and are the only way to weigh elements without a standard atomic weight.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses supported syntax (parentheses, brackets, hydrate dots such as CuSO4·5H2O, case-sensitive symbols, ignored trailing charge), that arithmetic is exact decimal using CIAAW abridged weights, and that elementWeights override the built-in table. It does not say what happens on an unparseable formula (error vs. partial result), which is the main remaining behavioral gap.

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 lead clause front-loads the purpose well, but the body is a single sprawling sentence, and the text terminates mid-word ('Elemen'), indicating a truncated definition. Content that is present earns its place; the run-on structure and dangling fragment cost it.

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?

For a six-parameter, all-optional computation tool with no output schema, the description covers inputs, computation method, and return values (Hill formula, g/mol weight, mass fractions). The truncated ending leaves some doubt about whether additional constraints were meant to be disclosed.

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?

Schema coverage is already 100%, so the baseline is 3; the description earns an extra point by explaining the claimedWeight/tolerance relationship as a pass/fail check and by clarifying elementWeights precedence and its role as the only way to weigh elements lacking a standard atomic weight. It does not add syntax detail for tolerance beyond the schema's default of 0.01.

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 specific resource (formula weight) and the exact operation (parse a chemical formula, return Hill-notation formula, g/mol weight from CIAAW weights, and mass fractions), plus the optional comparison against a claimed molar mass. 'Formula weight from a chemical formula' plus the enumerated outputs removes any ambiguity about what the tool produces.

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?

It gives clear operating conditions: use it when a chemist or agent 'must check a molar mass', pass claimedWeight and tolerance to validate a stated value, and note that mode=smiles 'validates syntax only' rather than computing a weight. No exclusions or named alternatives are offered, but none are obviously needed for a pure computation utility.

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