Skip to main content
Glama
phylokit-mcp
by musharna

Map a residue to its alignment column and across sequences

map_positions
Read-onlyIdempotent

Convert a residue position to its alignment column and a column back to each sequence's residue, handling gaps and aligning unaligned FASTA with MAFFT first.

Instructions

Map a residue to its alignment column, and the column to every sequence.

Answers "which residue of B is in the same column as residue N of A" without counting by hand. Positions count residues from 1, gaps not counted; columns count from 1. At a gap, a row's position is null and between gives the residues either side.

Args: aligned: true if the input is an alignment; false if unaligned, and it is aligned with MAFFT first, as align_sequences would. sequence: The sequence whose residue position is meant. position: A residue position in sequence. Give this or column. column: An alignment column. Give this or position. fasta: The sequences in FASTA. fasta_path: Path of a FASTA file to read instead of fasta. sequence_type: "dna" (default) or "protein".

Input Schema

NameRequiredDescriptionDefault
fastaNo
columnNo
alignedYes
positionNo
sequenceNo
fasta_pathNo
sequence_typeNodna

Output Schema

NameRequiredDescriptionDefault
rowsYes
queryYes
columnYes
windowYes
warningsYes
n_columnsYes
aligned_byYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/openWorldHint=false, so safety is covered; the description adds genuinely new behavioral facts beyond them — 1-based residue counting, gaps excluded from position counts, null positions at gapped rows with `between` supplying flanking residues, and the hidden MAFFT alignment step for unaligned input. It stops short of warning about the cost/nondeterminism of that implicit alignment or what happens on invalid positions.

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 core behavior and the clarifying question are front-loaded, and the args block is compact with one line per parameter. The `aligned` entry carries slightly more prose than the rest, but no sentence is filler.

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 not be fully spelled out, and all seven parameters plus the aligned/unaligned branch are covered. Remaining gaps are edge-case handling: what happens if both or neither of `position`/`column` are supplied, and how `sequence` is matched against `fasta`.

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?

With schema description coverage at 0%, the description must carry all seven parameters, and it does — each of aligned, sequence, position, column, fasta, fasta_path, and sequence_type gets a one-line explanation including the dna default. The weak spot is `sequence`, described only as "the sequence whose residue `position` is meant," leaving unclear whether it is an identifier/name key into `fasta` or the sequence text itself.

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?

The opening line states a precise verb and two-directional resource: residue -> alignment column, and column -> every sequence. The concrete question it answers ("which residue of B is in the same column as residue N of A") removes any ambiguity about what output to expect, and it is clearly distinct from alignment-building siblings like align_sequences.

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?

The description states both invocation modes explicitly ("Give this or `column`") and explains the branch on `aligned`: true means the input is already an alignment, false means it is aligned with MAFFT first. It does not, however, name a case where an agent should skip this tool entirely or point to a specific better alternative beyond the parenthetical reference to `align_sequences`.

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