io.github.tammy357/ts-second-opinion
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ANTHROPIC_API_KEY | No | API key for Anthropic Claude, needed to write new rules via the save_rule tool. Alternatively, the claude CLI can be used. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Checks machine-learned transition-state (TS) guesses before any DFT is spent. Rules are plain-English chemistry checks turned into Python and kept only if they accept >= 99% of 9,540 real DFT TSs (the gate). For your own reactions: triage_structures (reactant, product and TS guesses as xyz text; the atom-mapped SMILES is optional, since bonds and stereocentres can be read from the geometries) or triage_batch (a folder or CSV). For the benchmark: list_reactions -> triage_reaction -> explain. To add a rule: write a check, call gate_check, revise from its feedback, then save_rule. Never use score_against_reference to make decisions; it is for evaluation. Offer feedback_url ("Was this verdict right?") to the person; it opens a GitHub form and shares no structures.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_reactionsB | List reactions in the RDB7 test set (1,194 reactions, 8 GoFlow guesses each) with their triage verdict. verdict: 'green' (trust), 'amber' (check with DFT) or 'red' (re-generate). mirror_repaired: filter repaired ones. |
| triage_reactionA | Triage one RDB7 test reaction: run every gated rule on all 8 GoFlow guesses, pick the consensus among guesses that pass, repair a wrong-handed stereocentre by mirroring if that makes it pass, and return a verdict with reasons and the recommended TS geometry (xyz). score_against_reference adds D-MAE and stereo correctness against the reference DFT TS (evaluation only). |
| triage_structuresA | Triage your own reaction, from any TS generator and with any elements. Give the reactant and product geometries and one or more TS guesses as xyz text (multi-frame xyz allowed); several guesses enable the model-disagreement signal. mapped_reaction_smiles is optional: without it, bonds, bond orders and stereocentres are read from the reactant and product geometries (every file must then list the same atoms in the same order) and the inferred SMILES is returned for checking; charge and multiplicity then default to 0 and 1. With a SMILES (every atom, hydrogens too, mapped 1..N), order='map' if atoms are listed by atom-map number, 'smiles' if listed in the order they appear in the SMILES, and charge and multiplicity are read from it. |
| triage_batchA | Triage many reactions on disk at once. path: a folder with one sub-folder per reaction (reactant.xyz, product.xyz, the TS guess .xyz files, optional reaction.smi), or a .csv with columns id, reactant, product, guesses (and optional smiles, charge, multiplicity). Writes out_dir/verdicts.csv, the recommended geometry per reaction and ORCA inputs for reactions to check with DFT or re-generate. charge/multiplicity apply to reactions without a SMILES. |
| list_rulesA | List the plain-English rules, their gate results, and whether each is used in triage. |
| get_rule_sourceB | Show the Python code of a rule, so you can read it or use it as an example. |
| gate_checkA | Test a candidate rule check against 9,540 real DFT transition states (RDB7 training set) and distorted ones. python_source must define check(rxn, xyz) -> (passed: bool, detail: str); numpy is available as np and math as math; no imports. rxn offers: n, atoms, symbols, reactant_xyz, product_xyz, reactant_bonds, product_bonds ({(i, j): order}), changed_bonds, reaction_centre, neighbours('reactant'|'product'), reactant_chiral_tags, product_chiral_tags. Accepted if it passes >= 99% of real TSs, never crashes, and rejects >= 1% of mirrored or noisy TSs. Returns failing examples and feedback to revise the code. |
| save_ruleA | Save a rule check that passes the gate (re-tested on save). By default it goes to tsso/checks_user and is not used in triage; set use_in_triage=True only when a person has asked for it. |
| write_orca_inputB | Write an ORCA TS-optimisation input (wB97X-D4/def2-TZVP OptTS Freq, as in GoFlow's tsopt.inp) for the recommended guess of a test reaction. Returns the file paths and input text. |
| audit_rdb7_datasetA | Data-quality audit of RDB7: reactions whose reactant or product geometry contradicts the atom-mapped SMILES (atoms at single-bond distance that the SMILES does not bond, or a SMILES bond whose atoms are far apart). Uploaded reactions get the same check automatically (input_warnings in triage_structures). |
| evaluate_predictionsA | Stereo-aware evaluation of any TS generator: multi-frame xyz text of predictions and of reference TSs (one frame per reaction, same order) plus the atom-mapped reaction SMILES. Returns D-MAE, RMSD with and without the mirror image allowed, success rate, share with correct handedness, and success with correct handedness. |
| certify_trustA | Certified trust (conformal selection): calibrate on a random half of the RDB7 test reactions, then return which of the other half can be trusted so that, on average, at most target_error_rate of the trusted ones are wrong. count: 'geometry' (D-MAE > 0.2 A; what matters for barriers) or 'geometry_or_handedness'. The guarantee assumes new reactions are drawn like the calibration ones; recalibrate when the generator or data change. |
| benchmark_summaryB | Headline results, split into geometry errors and handedness errors: rates before and after, how many wrong-handed guesses the rules catch and how many are whole mirror images (same energy, so even DFT would not flag them), certified-trust numbers, and risk-coverage curves. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 13 tools
Most tools target clearly different objects: triage (single RDB7 reaction vs. user structures vs. batch on disk), evaluation, calibration, rule authoring, ORCA export, and dataset audit. The main soft spot is overlap between triage_reaction, triage_structures, and evaluate_predictions, which all produce geometry/stereo comparisons against references, though the descriptions sharply distinguish dataset, inputs, and purpose.
Nearly all names follow a verb_noun pattern (list_reactions, triage_reaction, evaluate_predictions, gate_check aside, save_rule, write_orca_input, audit_rdb7_dataset). Deviations like gate_check (noun_verb) and benchmark_summary (noun phrase) are minor and still readable, so the convention is largely predictable.
13 tools sit comfortably in the well-scoped range for a specialized TS-triage server. Each tool maps to a distinct stage of the workflow—triage, evaluation, calibration, rule development, export, and data audit—with no filler entries.
The surface covers the full workflow: single/batch/arbitrary triage, stereo-aware evaluation, trust calibration, rule listing, source inspection, gating, saving, ORCA input writing, and dataset auditing. Minor gaps exist—no update/delete for saved rules and no explicit regenerate/repair tool—but agents can work around these via existing triage and rule tools.