{"uid":"cap_8TghqdY0qk-TN15BujaC1","slug":"writerslogic-chemical-formula-weight-calculator-0751f3c4","name":"WritersLogic Chemical Formula Weight Calculator","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/formula-weight?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"mode":{"enum":["formula","smiles"],"type":"string","description":"formula (default) computes the weight; smiles validates syntax only."},"smiles":{"type":"string","maxLength":200,"description":"A single SMILES string without a name, at most 200 characters (mode smiles)."},"formula":{"type":"string","maxLength":200,"description":"Chemical 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."},"tolerance":{"type":"number","maximum":1000,"minimum":0,"description":"Allowed absolute difference from claimedWeight in g/mol. Default 0.01."},"claimedWeight":{"type":"number","maximum":1000000000,"minimum":0,"description":"Stated molar mass to check, g/mol."},"elementWeights":{"type":"array","items":{"type":"object","required":["symbol","weight"],"properties":{"symbol":{"type":"string","maxLength":3,"description":"Element symbol."},"weight":{"type":"number","maximum":1000,"minimum":0.0001,"description":"Atomic weight to use, g/mol."}}},"maxItems":20,"description":"Caller-chosen weights; they take precedence over the table and are the only way to weigh elements without a standard atomic weight."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lgiAGfM147RMV_v9dMzB_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses a chemical formula or validates SMILES syntax, returning the Hill-notation formula, molar mass in g/mol using CIAAW standard atomic weights, mass fractions, and optional molar mass verification","exampleAgentPrompt":"Can you calculate the formula weight of CuSO4·5H2O using CIAAW atomic weights and also check whether the stated molar mass of 249.69 g/mol is correct within a tolerance of 0.01 g/mol?","exampleUseCases":[{"title":"Molar mass verification for lab report","prompt":"I need to verify the molar mass of glucose (C6H12O6) — can you compute the exact formula weight using CIAAW standard atomic weights and confirm whether 180.16 g/mol is correct within 0.01 g/mol?"},{"title":"Hydrate formula weight lookup","prompt":"What is the molar mass of copper sulfate pentahydrate written as CuSO4·5H2O? Give me the Hill-notation formula and the mass fractions of each element too."},{"title":"SMILES syntax validation before submission","prompt":"Before I submit this structure to our pipeline, can you validate that the SMILES string 'C(C(=O)O)N' is syntactically correct according to the OpenSMILES grammar?"}],"resultDescription":"Returns the Hill-notation canonical formula, the formula weight in g/mol computed with CIAAW abridged standard atomic weights using exact decimal arithmetic, and mass fractions for each element. If claimedWeight and tolerance are provided, also returns a boolean verdict on whether the stated weight is within tolerance. For SMILES mode, returns a syntax validity result without computing a weight. Elements lacking a standard atomic weight return 'unknown' unless elementWeights overrides are supplied.","failureModes":["Unrecognized element symbol (case-sensitive) causes a parse error — CO is carbon monoxide, Co is cobalt","Elements without a standard atomic weight (Tc, Pm, elements above Bi except Th, Pa, U) return unknown weight unless elementWeights is provided","Formula exceeding 200 characters is rejected","Invalid SMILES syntax in smiles mode returns a syntax error rather than a weight","Isotope or deuterium notation in SMILES is not handled and may cause unexpected results","Charge notation not properly formatted may cause parse ambiguity (trailing ^2+, 2-, bare +/- are ignored but other formats may not be)"],"whenToPreferThis":"Choose this endpoint when you need a standards-compliant molar mass computed from CIAAW atomic weights with exact decimal arithmetic, especially for hydrates, coordination compounds, or ionic formulas. It is ideal for verifying a stated molecular weight against an authoritative source, or for canonicalizing a formula to Hill notation. Prefer it over general chemistry databases when you need a lightweight, deterministic computation without network lookups to external compound registries. Use SMILES mode specifically for grammar validation of SMILES strings, not for weight computation from SMILES.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-18T18:44:28.770Z","isFirstParty":false,"canonicalSlug":"writerslogic-chemical-formula-weight-calculator-0751f3c4"}