Skip to main content
Glama

Empirical formula

empirical_formula
Read-only

Calculate the simplest whole-number chemical formula from each element's mass or percent composition.

Instructions

Find the simplest whole number formula from mass composition. Pass each element's mass or its percent of the total.

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": {
      "composition": "<composition>"
    },
    "name": "empirical_formula"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitNoWhether the numbers are percentages or masses. Defaults to percent.
compositionYesEach element's mass or its percent of the total, like {C: 40.0, H: 6.7, O: 53.3}.

Output Schema

NameRequiredDescriptionDefault
countsYes
formulaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.3

TDQS

A3.6/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true and openWorldHint=false, so the safety profile is already covered. The description adds that either mass or percent input is acceptable, but says nothing about rounding behavior when the ratio isn't near-integer or how errors are surfaced for a pure-computation tool.

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 short sentences with the core operation front-loaded and the input convention immediately after; no filler or redundant phrasing.

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 so return values need no explanation, and both parameters are fully documented in the schema. For a two-parameter deterministic tool the description is nearly sufficient, only missing notes on result-certainty or failure modes.

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%, so the baseline is 3. The description reiterates that composition entries may be mass or percent, which slightly reinforces the 'unit' parameter, but adds no syntax or edge-case detail beyond what the schema already documents.

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 states a specific verb and resource ('Find the simplest whole number formula') and names the input ('mass composition'), which is enough to distinguish it from compute-style siblings like molar_mass or percent_composition. It stops short of naming the closest inverse sibling (percent_composition) explicitly.

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?

'Pass each element's mass or its percent of the total' implies how to invoke it, but there is no explicit when-to-use guidance, no exclusion against percent_composition or limiting_reagent, and no note about when the result may be ambiguous.

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