Skip to main content
Glama

collapse_rank

Collapse every monophyletic group at a selected taxonomic rank in a phylogenetic tree, with optional pre-coloring, to simplify rank-level views.

Instructions

Collapse all monophyletic groups at a rank (optionally auto-coloring at a rank first) — reproduces figtreekit --collapse-rank.

Args: rank: Rank to collapse (class, phylum, ...). collapse_style: collapse | cartoon. auto_color_rank: Rank for the pre-collapse palette coloring (defaults to phylum, matching the CLI). strict: Fail when a monophyletic group cannot be collapsed. taxonomy_mapping_file: Optional taxonomy mapping table (whitelisted), for trees whose taxonomy is not embedded in tip labels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rankNo
strictNo
run_nameNo
tree_fileNo
tree_contentNo
collapse_styleNocollapse
auto_color_rankNo
taxonomy_levelsNo
taxonomy_mapping_fileNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries full behavioral burden. It does disclose one real behavior — strict causes failure when a monophyletic group cannot be collapsed — but says nothing about what collapsing does to the tree, whether inputs are mutated or written to new files, or permission/whitelist constraints beyond the vague '(whitelisted)' note.

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?

The lead sentence is front-loaded and states purpose plus the CLI equivalence in one line, followed by a compact Args list. Every line carries information; the only cost is the docstring indentation that makes it slightly less scannable as tool prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 values need not be described, but the input story is incomplete: four parameters, notably the tree source (tree_file/tree_content) and run_name, are undocumented anywhere, and there is no guidance on how tree_file and tree_content interact or which is preferred.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 9 parameters, so the description must compensate. It documents 5 of them (rank, collapse_style, auto_color_rank, strict, taxonomy_mapping_file) and usefully enumerates collapse_style values that the schema lacks enums for, but leaves run_name, tree_file, tree_content, and taxonomy_levels — including the core tree-input parameters — completely unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb+resource+scope: collapse monophyletic groups at a given taxonomic rank, with the optional pre-coloring step called out. The 'at a rank' framing partially distinguishes it from sibling collapse_clade/collapse_group, though it never names those siblings to make the boundary explicit.

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

Usage Guidelines2/5

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

There is no statement of when to use this over collapse_clade, collapse_group, or run_figtreekit_cli, and no prerequisites for tree input. The only contextual hint is that taxonomy_mapping_file is for trees whose taxonomy is not embedded in tip labels, which is a narrow edge case rather than general routing guidance.

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