Skip to main content
Glama
phylokit-mcp
by musharna

Rank substitution models, with the margin over the runners-up

select_substitution_model
Read-onlyIdempotent

Compare and rank substitution models for aligned nucleotide or protein sequences using AIC, AICc, or BIC, then report top models, score gaps, and criterion agreement.

Instructions

Compare substitution models and report how much the winner won by.

A single model name reads as a finding. The ranking, the delta to the next model, and whether AIC/AICc/BIC agree are what make it one.

Args: fasta: Aligned sequences in FASTA, nucleotide or protein as declared by sequence_type. criterion: "AIC", "AICc" or "BIC". BIC penalises parameters more heavily. seed: Fixes the engine's search. top_n: How many ranked models to return. sequence_type: "dna" (default) or "protein". Ranks within that molecule type's model set — nucleotide and protein models are not comparable. fasta_path: Path of a FASTA file to read instead of fasta. models: Rank only these models (IQ-TREE names, e.g. ["JC", "K2P", "F81+F", "HKY+F"]), all returned. Bare "F81"/"HKY" have equal base frequencies in IQ-TREE; JC69, K80 and HKY85 are accepted.

Input Schema

NameRequiredDescriptionDefault
seedNo
fastaNo
top_nNo
modelsNo
criterionNoAIC
fasta_pathNo
sequence_typeNodna

Output Schema

NameRequiredDescriptionDefault
seedYes
rankingYes
warningsYes
alignmentYes
criterionYes
best_modelYes
restricted_toNo
criteria_agreeYes
resolved_namesNo
best_by_criterionYes
n_models_comparedYes
indistinguishable_from_bestYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.7.0
    • addedInput schema / properties / fasta / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / fasta / default
      Added value: +null
    • removedInput schema / properties / fasta / type
      Removed value: -"string"
    • addedInput schema / properties / fasta_path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Fasta Path"
      +}
    • addedInput schema / properties / models
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Models"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "fasta"
      -]
    • addedOutput schema / properties / resolved_names
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "title": "Resolved Names",
      +  "type": "object"
      +}
    • addedOutput schema / properties / restricted_to
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Restricted To",
      +  "type": "array"
      +}
  2. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / sequence_type
      Added value: +{
      +  "default": "dna",
      +  "title": "Sequence Type",
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and closed-world behavior, so the description is not carrying the safety burden. It adds substantial domain behavior: nucleotide and protein model sets are not comparable, BIC penalizes parameters more heavily, bare 'F81'/'HKY' have equal base frequencies in IQ-TREE, and aliases like JC69/K80/HKY85 are accepted. This is meaningful context beyond the structured fields.

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 description is front-loaded with the core purpose, then explains why the ranking matters, then lists arguments cleanly. It is appropriately sized for a seven-parameter tool, though the middle rationale sentence is slightly editorial rather than strictly operational.

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?

Given seven parameters, no schema descriptions, and an output schema already present, the description is nearly complete: it covers every parameter and the main semantic caveats around model comparability and naming. It does not address edge cases such as what happens when neither fasta nor fasta_path is supplied, which keeps it from a 5.

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%, so the description must carry parameter meaning entirely, and it does. It documents all seven parameters, including criterion choices and their trade-off, seed's role in fixing the engine search, sequence_type's default and model-set implications, and detailed IQ-TREE naming/alias rules for models.

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?

The opening sentence states a specific verb and resource: 'Compare substitution models and report how much the winner won by.' It also explains the ranking/delta/agreement output, making the tool's role concrete. It does not explicitly distinguish itself from siblings such as infer_tree, so it stops short of a 5.

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

Usage Guidelines3/5

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

The description implies when to use it by contrasting a single model name with a full ranking ('A single model name reads as a finding...'), so the usage context is inferable. However, it gives no explicit when-not-to-use guidance and never names an alternative tool, leaving routing to inference.

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