Skip to main content
Glama

scan_library

Read-onlyIdempotent

Recursively scan a directory to summarize file counts by extension, total bytes, and earliest/latest modification times, helping you assess a photo library's size and structure without reading file contents.

Instructions

Recursively scan a directory and summarize what is in it.

Walks root recursively (symlinks are not followed) and reports file counts by extension, total bytes, and the earliest/latest file modification time. Stops after 50000 files and reports truncation if the library is larger than that. Does not read file contents or EXIF; use library_stats for EXIF aggregates.

Args: params (ScanLibraryInput): Validated input containing: - root (str): Directory to scan, must be inside an allowed --root

Returns: dict: { "schema_version": 1, "root": str, "total_files": int, "total_bytes": int, "counts_by_extension": {".jpg": int, ...}, "earliest_mtime": str | None, # ISO 8601 UTC "latest_mtime": str | None, # ISO 8601 UTC "truncated": bool, "truncation_note": str | None, } On error: {"schema_version": 1, "error": str}

Examples: - Use when: "How many files are in my 2026 shoot folder and how big is it?" - Don't use when: you need EXIF camera/lens breakdowns (use library_stats)

Input Schema

NameRequiredDescriptionDefault
paramsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, but the description still adds real substance: symlinks are not followed, the walk halts at 50000 files, truncation is reported in the result, and errors return a schema_version/error dict. That is exactly the kind of behavior an agent cannot infer from 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?

Front-loaded with a one-line summary, then behavior, then args/returns/examples in a scannable order. It is somewhat long, but with no output schema the Returns block earns its space; the redundancy of mentioning library_stats twice is the only real waste.

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?

With no output schema and 0% schema description coverage, the description carries the full burden and does so: it documents every returned key including the truncation fields and the error shape. An agent can call this correctly and interpret the result without further information.

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?

There is only one parameter and the description restates its constraint (must be inside an allowed --root), which is the operative safety boundary for the call. The schema's own field description already carries this, so the description adds reinforcement rather than new meaning; a 4 rather than a 5 for a single trivially-shaped string param.

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 first sentence gives a specific verb and resource ("Recursively scan a directory and summarize"), and the body adds scope boundaries: walks recursively, does not follow symlinks, does not read contents or EXIF. It explicitly names the sibling for the EXIF case, so it is distinguishable from library_stats without opening either schema.

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?

The Examples block states both when to use ("How many files are in my 2026 shoot folder and how big is it?") and when not to use, naming library_stats as the alternative for EXIF aggregates. The body also routes to library_stats a second time, reinforcing the exclusion.

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