Skip to main content
Glama

build_species_tree

Build a species or guide tree from a join formula and Imap, then write PREFIX.stree and PREFIX.nwk for use as BPP stree_file.

Instructions

Build the species (or guide) tree from a join formula (bpp-tree).

Writes PREFIX.stree (the species&tree block, with individual counts taken from the Imap, plus any migration block) and PREFIX.nwk. Pass PREFIX.stree to make_control_file as stree_file.

  • joins: comma-separated joins, each 'X+Y' or 'X+Y=name', e.g. 'chimp+bonobo=pan, pan+human, gorilla+pan_human'. A label like A_B refers to the clade of A and B. Tip names are the Imap's species names. Ask the user for the tree (or guide tree for delimitation); do not invent one.

  • migration (MSC-M): bands 'SRC->DST, ...'. Mutually exclusive with introgression. The control file then also needs a wprior.

  • introgression (MSC-I): events 'DONOR->RECIP phi=0.1, ...'. The control file then also needs a phiprior. Look up those priors with lookup_docs; lint_control_file reports what is missing.

Read in the report: newick, taxa, species_counts, species_and_tree_block, and warnings (e.g. ROOT_AUTO_JOINED: two clades were joined at the root automatically) and errors. server.diagram is an ASCII drawing of the tree. ALWAYS show the user the diagram and ask them to confirm the topology before going on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imapYes
joinsYes
migrationNo
out_prefixYes
introgressionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and openWorldHint=false. The description adds critical behavior beyond that: the exact output files written (PREFIX.stree and PREFIX.nwk), the need to inspect warnings and errors, that warnings can include ROOT_AUTO_JOINED, and that server.diagram must be shown to the user for topology confirmation before proceeding.

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?

Front-loads the core purpose, then presents output files, parameter guidance, and reporting details in tight bullets. Every sentence adds actionable information with no wasted restatement.

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?

For a mutation tool with no output schema and several interacting parameters, the description covers file outputs, parameter interactions, prerequisites (wprior/phiprior), warnings and errors, and the required user-confirmation step with the ASCII diagram. Nothing important for correct invocation appears missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 carry the burden. It thoroughly explains joins with examples, migration bands, and introgression events. It also references imap (tip names and individual counts) and out_prefix (PREFIX.stree/PREFIX.nwk), though it does not explicitly name or define those two parameters as directly as it could.

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 specific verb and resource: 'Build the species (or guide) tree from a join formula (bpp-tree)'. This clearly distinguishes it from the sibling read_species_tree, which reads an existing tree rather than constructing one.

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 says to ask the user for the tree and not invent one. It also tells the agent to pass PREFIX.stree to make_control_file as stree_file, notes that migration and introgression are mutually exclusive, and directs the agent to lookup_docs and lint_control_file for needed priors.

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