Skip to main content
Glama
mariusei

Scantool - File Scanner MCP

by mariusei

Search Structures

search_structures

Find code structures or text with context: each match shows its enclosing function/class plus where names are defined. Filters by type, name pattern, or decorator.

Instructions

Text across a directory (or one file) with structural context: each hit shows its enclosing structure, plus leads to where matched names are defined; when no lead exists it says so. --names matches structure names instead of text, and an empty answer names the paths that match. The pattern is a Python regex; grep's \| is read as alternation with a note. --type filters which structures are reported. 40 structures per page, --limit/--offset for the rest, and the page is stated. content_pattern finds text with its enclosing function/class/section plus leads to definitions; name_pattern/type_filter/has_decorator find structures; ref= searches at a git ref. Best first call for a targeted question; use instead of Grep. In your shell: sct search <dir> <pattern> (if sct is not on PATH, "/app/.venv/bin/python" -m scantool.cli replaces sct).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNo
limitNo
offsetNo
directoryYes
type_filterNo
name_patternNo
has_decoratorNo
output_formatNotree
min_complexityNo
content_patternNo
include_metadataNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.26.0
    • addedInput schema / properties / ref
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed3 schema fields changedv0.23.0
    • addedInput schema / properties / include_metadata
      Added value: +{
      +  "default": true,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 40,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "type": "integer"
      +}
  3. Changed1 schema field changedv0.20.1
    • addedInput schema / additionalProperties
      Added value: +false
  4. First observedv0.19.4

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses pagination (40 per page, --limit/--offset, page stated), the empty-answer behavior ('an empty answer names the paths that match'), the grep alternation quirk ('grep's \| is read as alternation with a note'), and the CLI invocation fallback. It does not explicitly state that the tool is read-only, but the search semantics and 'use instead of Grep' strongly imply a non-mutating operation. The only minor gap is not stating whether results are sorted or how the tree output is structured, but the description is rich enough to earn a 4.

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 description is dense but front-loaded: the first sentence establishes the core value proposition, and the rest adds mode distinctions, pagination, and CLI invocation. It is longer than ideal, but every sentence carries distinct information. The CLI invocation detail at the end is useful but could be trimmed or moved to a separate field; still, the structure is logical and scannable.

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 a complex 11-parameter tool with no annotations and no output schema, the description covers the main usage modes, pagination, edge-case behavior (empty answer, grep alternation), and CLI fallback. It does not document output_format, min_complexity, or include_metadata, and it does not describe the return value shape beyond 'each hit shows its enclosing structure'. Given the tool's complexity, a 4 is appropriate; a 5 would require explicit coverage of every parameter and the output format.

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 description coverage is 0%, so the description must compensate for the 11 parameters. It explains the key parameter groups: content_pattern (text with enclosing structure), name_pattern/type_filter/has_decorator (structure-name search), ref (git ref), limit/offset (pagination), and --names (which maps to name_pattern). It does not explain output_format, min_complexity, or include_metadata, but the core decision-driving parameters are covered. Given the high parameter count and zero schema coverage, this is a strong compensation effort, though not perfect.

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 description opens with a specific verb ('Search') and resource ('text across a directory or one file') and immediately distinguishes itself from plain grep by adding structural context: each hit shows its enclosing structure and leads to definitions. It also names the sibling alternative ('use instead of Grep') and explains the --names mode, so an agent can tell exactly what this tool does and how it differs from a plain text search.

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 description explicitly says 'Best first call for a targeted question; use instead of Grep', giving a clear when-to-use directive and naming the alternative. It also explains the two main modes (content_pattern vs name_pattern/type_filter/has_decorator) and the ref= option, so an agent knows which parameters to set for which intent. This is unusually complete usage guidance.

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