Skip to main content
Glama
phylokit-mcp
by musharna

Compare two tree topologies

compare_trees
Read-onlyIdempotent

Compute Robinson-Foulds distance between two Newick trees and identify their differing clades by comparing splits, not string representations.

Instructions

Robinson-Foulds distance between two trees, and which clades differ.

Compares SPLITS, not strings: the same topology has many valid Newick representations, so string equality answers a different question.

Args: newick_a: First tree in Newick format. newick_b: Second tree in Newick format. trees_path: Instead of the two strings, the path of a file holding exactly two Newick trees, A then B.

Input Schema

NameRequiredDescriptionDefault
newick_aNo
newick_bNo
trees_pathNo

Output Schema

NameRequiredDescriptionDefault
warningsYes
only_in_aYes
only_in_bYes
shared_taxaYes
n_shared_cladesYes
robinson_fouldsYes
identical_topologyYes
normalised_robinson_fouldsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.7.0
    • addedInput schema / properties / newick_a / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / newick_a / default
      Added value: +null
    • removedInput schema / properties / newick_a / type
      Removed value: -"string"
    • addedInput schema / properties / newick_b / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / newick_b / default
      Added value: +null
    • removedInput schema / properties / newick_b / type
      Removed value: -"string"
    • addedInput schema / properties / trees_path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Trees Path"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "newick_a",
      -  "newick_b"
      -]
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already cover read-only, idempotent and closed-world behavior, and the description adds useful substance: the metric used, that equivalent topologies have many valid Newick strings, and that clade differences are part of the result. However, with all three parameters optional and defaulting to null, it never says what happens if neither the two strings nor a path are supplied, nor how malformed Newick is handled.

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?

The key semantic point — splits, not strings — is front-loaded before the argument list. The Args block is compact and each entry adds information rather than restating the parameter name.

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

Completeness4/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 no explanation, and the mutually exclusive input modes are spelled out. The remaining gap is the all-optional parameter set: an agent cannot tell from the description what constitutes a valid call (pair of strings vs path) or what happens when everything is null.

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 coverage is 0%, so the description has to carry all parameter meaning, and it does name and explain all three. 'trees_path' gets the strongest treatment, specifying that the file must hold exactly two Newick trees, A then B, which is meaning nothing in the schema conveys. The two Newick string args are defined only as 'First/Second tree', leaving the pairing A-to-B implied rather than stated.

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 metric (Robinson-Foulds distance) applied to a specific resource (two trees), plus the secondary output (which clades differ). The clarification that it compares SPLITS rather than strings sharpens the purpose beyond the title and clearly separates it from the alignment/model siblings.

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

Usage Guidelines4/5

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

Explicitly warns that string equality 'answers a different question', which is a genuine when-to-use signal, and frames the two input modes as mutually exclusive ('Instead of the two strings...'). It stops short of naming any sibling tool or stating when a different comparison approach would be preferred.

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