Skip to main content
Glama

jean — Molecular Biology & Genomics

trim_reads

Read-only

Trim sequencing adapters and low-quality ends off FASTQ reads before mapping, and report what was removed. This is cutadapt's algorithm: quality trimming is BWA's running-sum rule (not a threshold - a single bad base in a good tail is absorbed, a real decline is not), and the adapter is found by semiglobal alignment allowing errors, so a PARTIAL adapter at the very end of a read is caught where a substring search would miss it. Quality trimming runs FIRST and adapter removal second, which is cutadapt's own order and changes the result when a low-quality tail is also the start of an adapter. THE REPORT ATTRIBUTES EVERY REMOVED BASE TO THE STEP THAT REMOVED IT, because losing 30% of your bases to quality means a bad sequencing run and losing it to adapter means a short insert - different problems that one total cannot distinguish. It does not map anything and does not filter reads: a read trimmed to nothing is returned empty and counted, never silently dropped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
readsYesthe reads to trim, as FASTQ - quality lines are required, because both halves of this need them.
_filesNoThe 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.
adapterNothe adapter sequence to remove. Unset means quality trimming only. Illumina TruSeq is AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC and Nextera is CTGTCTCTTATACACATCT.
_subjectNoThe 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.
min_lengthNoreads shorter than this after trimming are COUNTED as too short, not removed - this tool does not filter. 0 reports none. Advanced.
min_overlapNoan adapter overlap shorter than this is ignored. Low values trim real bases by chance - at 1, a read ending in the adapter's first base is 'trimmed'. Advanced.
adapter_kindNowhich end the adapter sits at. A read running off the end of its insert hits the 3' adapter, which is why that is the default.three_prime
phred_offsetNoquality encoding: 33 for every modern FASTQ, 64 only for pre-1.8 Illumina. Advanced.
max_error_rateNoerrors allowed in the adapter match, as a fraction of the overlap. cutadapt's own default. Advanced.
quality_cutoff_backNoquality cutoff for the 3' end, where quality decays with cycle number. 0 is off; 20 is the usual choice. NOT a threshold on individual bases - see the description.
quality_cutoff_frontNoquality cutoff for the 5' end, which fails for different reasons than the 3' end and so takes its own number. 0 is off, and off is the usual answer. Advanced.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
reportYeswhat was removed and by which step: bases before and after, the two attributed counts, reads with an adapter, reads emptied and reads left too short
readsEmptiedYesreads trimmed to nothing at all - a different alarm from 'too short', because it usually means the read was all adapter
trimmedFastqYesthe trimmed reads as FASTQ, ready for `map_reads`
readsWithAdapterYeshow many reads carried the adapter - the number that says whether your insert size is shorter than your read length
basesRemovedByAdapterYesbases removed by adapter trimming alone
basesRemovedByQualityYesbases removed by quality trimming alone

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/non-destructive, yet the description adds substantial behavioral detail: the cutadapt running-sum quality rule, semiglobal adapter alignment that catches partial 3' adapters, the quality-then-adapter ordering and why it matters, and per-step base attribution in the report. It also discloses the non-obvious non-filtering behavior (a read trimmed to nothing is returned empty and counted, not dropped).

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?

Purpose is front-loaded in the first clause and every subsequent sentence carries behavioral substance rather than filler. The prose is dense and occasionally long-winded (the ALL-CAPS emphasis on per-step attribution is heavy), but nothing is redundant with the schema.

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?

For an 11-parameter transformation tool with nested objects and a 100%-covered schema, the description completes the picture: it explains the algorithm, the ordering, the reporting semantics, and the explicit non-goals. An output schema exists, so return structure need not be spelled out, and the description still covers what the report contains.

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 100% so the baseline is 3, and the description lifts this by explaining the algorithm that gives the parameters meaning: it clarifies quality_cutoff_back is not a per-base threshold, and that partial adapter detection is what max_error_rate/min_overlap govern. This adds interpretive value beyond the field text.

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?

Opens with a specific verb and resource ('Trim sequencing adapters and low-quality ends off FASTQ reads') plus the workflow position ('before mapping') and output ('report what was removed'). This clearly distinguishes it from siblings like demultiplex_reads, align_read, and map_reads without needing to open the schema.

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?

'before mapping' places the tool in the workflow and the closing sentence partitions scope by stating it does not map and does not filter, which routes the agent correctly. It stops short of explicitly naming sibling alternatives (e.g. demultiplex_reads) or giving when-not conditions, so it is clear but not fully channelled.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources