compare_trees
Compare trees over the same taxa: the Robinson-Foulds distance between two of them, and the consensus of any number.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"trees": "<trees>"
},
"name": "compare_trees"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | how strict the consensus is: strict keeps only clades in EVERY tree; majority keeps those above the cutoff. Values: majority (Majority-rule), strict (Strict). | majority |
| trees | Yes | two or more trees in Newick (NEXUS, PhyloXML and NeXML pastes are sniffed too) — wire `newick` outputs here. | |
| _files | No | The project: record references shaped like _subject. Their records become library documents a tool names in sequences/parts/document; a trace or alignment is found by file name. | |
| cutoff | No | the fraction of trees a clade must appear in for a majority consensus. Only applies when mode is majority. | |
| _subject | No | The record to act on: exactly one of sequence, accession (+source), sample (an id from list_samples) or file ({name, text} or {name, base64}); record_index picks one record of several. | |
| sharedTaxaOnly | No | prune every tree to the taxa they ALL share before comparing, instead of refusing a mismatch. The numbers then describe the pruned trees, and pruning can only remove or merge splits, so the distance is a lower bound on the disagreement between the trees as given. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rf | Yes | Robinson-Foulds distance between the first two trees (absent for one tree) | |
| consensus | Yes | the consensus tree, in Newick | |
| distances | Yes | every distance the comparison computes, not just RF | |
| treeCount | Yes | how many trees went into the consensus | |
| normalized | Yes | the same distance as a fraction of its maximum, 0 = identical topology, 1 = share nothing | |
| prunedTaxa | Yes | under `sharedTaxaOnly`: the labels dropped from each tree, so a comparison over a smaller set can never be read as one over the whole | |
| comparedTaxa | Yes | how many taxa the distances were computed over — under `sharedTaxaOnly` this is the shared set, which is smaller than either tree |