Skip to main content
Glama
phylokit-mcp
by musharna

Align sequences with MAFFT, ready for infer_tree

align_sequences

Align 2-200 unaligned DNA or protein sequences with MAFFT to produce equal-length FASTA ready for phylogenetic tree inference or substitution model selection.

Instructions

Align unaligned sequences with MAFFT, ready for infer_tree.

The returned fasta has every row the same length and can be passed to infer_tree or select_substitution_model unchanged. Each output row, with its gaps removed, is verified to equal the input sequence before it is returned.

Args: fasta: UNALIGNED sequences in FASTA, 2-200 of them. Gap characters are refused: input that is already aligned does not need this tool. sequence_type: "dna" (default) or "protein". Declared, never sniffed, and passed to MAFFT explicitly so it does not guess either. fasta_path: Path of a FASTA file to read instead of fasta. out_path: Write the aligned FASTA to this NEW file (never overwritten; its directory must exist) instead of returning it: fasta comes back None and written_to holds the absolute path, which infer_tree, select_substitution_model and map_positions take as fasta_path. Use it rather than copying rows between calls.

Input Schema

NameRequiredDescriptionDefault
fastaNo
out_pathNo
fasta_pathNo
sequence_typeNodna

Output Schema

NameRequiredDescriptionDefault
fastaYes
engineYes
warningsYes
alignmentYes
written_toYes
input_lengthsYes
sequence_typeYes
ready_for_infer_treeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.8.0
    • addedInput schema / properties / out_path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Out Path"
      +}
    • addedOutput schema / properties / fasta / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / fasta / type
      Removed value: -"string"
    • addedOutput schema / properties / written_to
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "title": "Written To"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "fasta",
      -  "alignment",
      -  "sequence_type",
      -  "input_lengths",
      -  "engine",
      -  "ready_for_infer_tree",
      -  "warnings"
      -]New value: +[
      +  "fasta",
      +  "written_to",
      +  "alignment",
      +  "sequence_type",
      +  "input_lengths",
      +  "engine",
      +  "ready_for_infer_tree",
      +  "warnings"
      +]
  2. Changed5 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"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "fasta"
      -]
  3. Addedv0.5.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations mark this readOnly=false and idempotent=false, and the description supplies exactly the context the annotations cannot: every output row is verified gap-stripped against the input, out_path is never overwritten and its directory must pre-exist, and fasta returns None with written_to holding the absolute path. That is substantive behavioral disclosure for a write-capable tool.

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?

Front-loaded with the one-sentence purpose and return contract before the Args block, and every sentence carries information. Slightly dense in the out_path sentence, where a clause about which tools accept written_to as fasta_path could be tightened, but there is no filler.

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?

A 4-parameter mutation tool with an output schema, and the description still tells the agent everything needed: input constraints, sequence-type handling, the return-shape switch on out_path, and how downstream tools consume either form. Nothing an agent needs in order to call it correctly is missing.

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 all four parameters – and it does: fasta (2-200 unaligned sequences, gaps refused), sequence_type (dna/protein, declared never sniffed, passed to MAFFT explicitly), fasta_path (file alternative to fasta), and out_path (new file, directory must exist, changes return shape). This far exceeds the schema's bare titles and defaults.

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 (align unaligned sequences with MAFFT) plus the downstream purpose (ready for infer_tree). It names the exact siblings that consume the output (infer_tree, select_substitution_model, map_positions), so an agent can place it in the workflow without opening other schemas.

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 input must be UNALIGNED and that gap characters are refused because already-aligned input 'does not need this tool' – a clear when-not condition. It also directs the agent to prefer out_path rather than shuffling rows between calls, which is prescriptive routing guidance.

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