Skip to main content
Glama

Classify files

classify_files

Classify files into your custom labels using a decision model, returning grouped results with calibrated confidence. Use it to triage tests, configs, and dead code, or sort documents by topic.

Instructions

Classify every file in the given paths into your labels with a decision model (one very cheap request per file, calibrated confidence). Returns files grouped by label. Good for triage: tests/configs/dead code, sorting documents by topic, flagging files about X. Label descriptions after a colon noticeably improve accuracy.

Input Schema

NameRequiredDescriptionDefault
modelNoOverride the OpenRouter decision model for this call, e.g. cloudflare/clef (see list_models)
pathsYesFiles and/or directories to read (absolute or relative to the project root)
formatNoOutput format (default grouped)
labelsYesLabel names, optionally with a description after a colon, e.g. ["bug: describes a defect", "feature", "question"]
dry_runNoOnly list which files would be scanned and the estimated tokens; no API call
excludeNoExtra globs to skip, e.g. ["**/*.test.ts"]
includeNoGlob patterns inside directories, e.g. ["**/*.ts", "docs/**/*.md"]. Default: all text files
multi_labelNoAllow several labels per file (default false)
instructionsNoExtra classification criteria
respect_gitignoreNoSkip files ignored by the directory's .gitignore (default true)
max_chars_per_fileNoTruncate each file to this many chars, keeping head and tail (default 12000; capped to the model's context)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the cost model (one very cheap request per file), that confidence is calibrated, that files are read and returned grouped, and that label descriptions improve accuracy. It does not state that the operation is read-only/non-destructive nor mention rate limits or failure behavior for unreadable files.

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?

Dense and front-loaded: purpose and cost appear in the first sentence, return shape in the second, use cases third, accuracy tip last. Every sentence earns its place, though the parenthetical cost note interrupts the main clause slightly.

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?

For an eleven-parameter tool with no annotations and no output schema, the description covers purpose, cost, output grouping, and the key accuracy lever. Minor gaps: it only mentions the 'grouped' shape although format supports table/json, and it says nothing about dry_run or include/exclude interplay.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the eleven parameters are already well documented, including the colon-description convention for labels. The description reinforces that convention but adds no new syntax, defaults, or constraints beyond the schema, so baseline 3 applies.

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?

States a specific verb+resource (classify every file into your labels) plus the mechanism (decision model) and the return shape (files grouped by label). It is clear enough to act on, but it never differentiates itself from the sibling decide_files, which by name sounds closely related.

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?

Concrete when-to-use guidance is given: triage of tests/configs/dead code, sorting documents by topic, flagging files about X. It lacks any exclusions or an explicit pointer to decide_files versus locate_in_files, so the agent must infer the boundary.

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