Skip to main content
Glama

generate_mechanism

Draws step-by-step SN2, SN1, or Fischer esterification mechanisms with curved arrows using your substrates, showing each electron-flow step.

Instructions

Show a reaction mechanism step by step with curved arrows, drawn with the user's own substrates.

Three mechanism families, each with a stated limit: SN2 — a methyl, primary or secondary alkyl chloride, bromide or iodide with one anionic nucleophile (OH⁻, CN⁻, I⁻, Br⁻, RO⁻, N₃⁻, RS⁻/HS⁻); a stereocentre is inverted. SN1 — a tertiary, benzylic or allylic alkyl halide with water, an alcohol or one of those anions. Fischer esterification — one carboxylic acid with one primary or secondary alcohol. Substrates outside the limit return an error that names the reason. Without substrates, or if the drawing fails, the textbook example is shown and the result says so (substrates_drawn, fallback_reason).

Use this when the user asks about one of these mechanisms, electron-flow arrows, or wants to see how such a reaction proceeds step by step.

A question that starts "why does …" or "I don't understand why …" about a mechanism is the same request in disguise ("why does SN2 invert the centre?"). The arrows ARE the explanation; draw them and explain alongside, rather than describing them in words.

Not this tool for: the net equation educt → product without intermediates — that is generate_reaction. Only the mechanism types listed in reaction_type exist; for anything else use generate_reaction.

Args: reaction_type: "sn2", "sn1" or "fischer_ester". substrates: The user's substrates (names or SMILES): halide and nucleophile, or acid and alcohol. current_step: 0 = overview (all steps), 1-N = specific step.

Input Schema

NameRequiredDescriptionDefault
substratesYes
current_stepNo
reaction_typeYes

Output Schema

NameRequiredDescriptionDefault
nameYes
typeNomechanism
stepsYes
current_stepNo
reaction_typeYes
fallback_reasonNo
substrates_drawnNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does so: it states the hard substrate limits per family (e.g. SN2 needs methyl/primary/secondary halide plus one anionic nucleophile; SN1 needs tertiary/benzylic/allylic), that out-of-limit substrates return an error naming the reason, and that missing substrates or drawing failure fall back to the textbook example with substrates_drawn and fallback_reason set. It also discloses the stereocentre inversion outcome, which is genuine behavioral information rather than restated input.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, then organized into family limits, usage triggers, exclusions, and args — a structure an agent can scan. It is long-ish and mildly repetitive, since the exclusion of generate_reaction is stated twice (once as 'Not this tool for' and once as 'for anything else use generate_reaction'), but nearly every sentence carries information.

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?

An output schema exists, so return-value structure need not be explained, yet the description still names the key result fields (substrates_drawn, fallback_reason). Combined with per-family preconditions, error behavior, and fallback behavior, nothing an agent needs in order to call this correctly for a three-parameter chemistry tool is missing.

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 0%, so the description must compensate, and it does for all three parameters: reaction_type's three values, substrates as names or SMILES with the per-family pairing (halide + nucleophile, or acid + alcohol), and current_step as 0 = overview of all steps versus 1-N = a specific step. This adds real meaning beyond the bare enum and array types.

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 opening line states a specific verb and resource — draw a reaction mechanism step by step with curved arrows using the user's substrates — and the three supported families (SN2, SN1, Fischer esterification) are enumerated. It explicitly names the sibling it is not (generate_reaction) and the condition that separates them (net equation without intermediates).

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

Usage Guidelines5/5

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

It gives an explicit when-to-use trigger (user asks about these mechanisms or electron-flow arrows) and an explicit when-not (net educt → product is generate_reaction; unsupported mechanism types are generate_reaction). It even resolves the ambiguous case of 'why does …' questions, telling the agent that is the same request and to answer with arrows rather than prose.

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