Skip to main content
Glama

generate_species_distribution

Plot acid–base species fractions against pH from pKa values to identify the dominant protonation state, degree of ionization, and likely membrane absorption at any pH.

Instructions

Draw the species distribution of an acid over pH (Henderson-Hasselbalch).

Plots the fraction α of every protonation species against pH with the pKa values marked — the standard diagram for absorption/distribution reasoning in pharmacy.

Use this when the user asks which species dominates at a given pH, about degree of ionization, or absorption across membranes. YOU supply pKa values (ascending) from your knowledge; pass species labels (formulas like "H₂PO₄⁻") for a readable legend.

Not this tool for: pH against added titrant volume, equivalence points or indicator choice (use generate_titration_curve). It answers "which species when", not "what pH do I have" — the pH of a solution or buffer, or the ionised fraction at one pH, as a number is calculate_ph.

Args: substance: Display name, e.g. "Phosphoric acid" (localizable). pka_values: pKa per protolysis step, ascending. labels: Optional species labels, most protonated first (len = len(pka_values) + 1).

Input Schema

NameRequiredDescriptionDefault
labelsNo
substanceYes
pka_valuesYes

Output Schema

NameRequiredDescriptionDefault
svgNo
nameYes
typeNoplot
filesNo
notesNo
subtitleNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are present, so the description carries the full burden; it discloses that it renders a plot with pKa values marked and that the caller must supply pKa values from its own knowledge. What is missing is the output medium (image vs. saved file) and any note about handing off to save_png, which matters given a save_png sibling.

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 purpose, then when-to-use, then exclusions, then an Args block — a clean hierarchy with no filler sentences. Minor redundancy: the Args section largely restates parameter meaning already given in prose, and the "standard diagram" aside is decorative.

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 detail is not required, and the description covers purpose, selection criteria, alternatives, and all three parameters with their ordering constraints. Nothing an agent needs to invoke this correctly is absent.

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%, and the description fully compensates: substance is a localizable display name, pka_values are per protolysis step and must be ascending, and labels are optional, most-protonated-first, with the hard constraint len(labels) = len(pka_values) + 1. None of that appears in the raw schema titles.

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?

States a concrete verb and resource ("Draw the species distribution of an acid over pH") plus the underlying method (Henderson-Hasselbalch). It immediately distinguishes itself from titration-curve and pH-calculation siblings, so an agent can pick it without opening the schema.

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?

Explicitly names the triggering user intents (which species dominates at a given pH, degree of ionization, absorption across membranes) and supplies a formal exclusion block routing titrant-volume/equivalence-point questions to generate_titration_curve and numeric pH/ionised-fraction questions to calculate_ph.

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