Skip to main content
Glama

writ_scan

Scan a local directory for consequential writes without calling the gate or modifying files. Returns per-language counts and capped findings to support commit-time policy review.

Instructions

Scan a local directory for consequential writes (no gate call).

LOCAL-ONLY: this tool never calls the Writ gate, needs no API key, and never rewrites files. It runs the pywrit scanner in-process over the directory: Python (ast, always available), plus TypeScript/JavaScript and Go (tree-sitter, scan-only exactly as the CLI reports them - the scanner never instruments those files).

Prerequisite: the pywrit scanner must be installed in the same Python environment as this server; TS/JS and Go parsing additionally needs the polyglot extra:

pip install "pywrit[polyglot]"

Args: path: Directory to scan (test files and vendored trees are skipped). include_non_product: Also report writes under docs/, scripts/, examples/, sandbox/, benchmark/, demo/, and build-tooling files. Default False: they are counted under per-language "suppressed" totals instead of becoming findings (never silently dropped). max_findings: Findings list cap (default 25, minimum 1). When the cap cuts the list, "findingsTruncated" carries the count left out.

Returns a summary: path, per-language files/sites/gated counts, suppressed non-product totals by class, notScanned per language when the polyglot extra is missing (files seen, none scanned), a verdict line, and findings capped at max_findings: [{file (relative to the scanned root), line, kind, function, class, verb, snippet}] sorted by file then line. On error returns {error, status, detail}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "writ_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
max_findingsNo
include_non_productNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.28

TDQS

A4.5/5.0
Behavior5/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 so: it discloses that files are never rewritten, that TS/JS/Go are scan-only and never instrumented, what notScanned means when the extra is missing, how the findings cap and findingsTruncated behave, and the error shape {error, status, detail}.

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?

Sectioned and front-loaded, with the local-only caveat before the details. The pip install block and prose about the polyglot extra are somewhat verbose, but each part carries actionable information, so little is wasted.

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 a 3-parameter scan tool with an output schema, the description still explains the return structure, truncation, and error cases, and covers the installation dependency that determines whether TS/JS/Go are scanned at all. Nothing an agent needs to invoke it correctly is missing.

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

Parameters5/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 and it does, documenting all three parameters: path (with skip rules for test files and vendored trees), include_non_product (exact directories affected, default False, and the suppressed-totals semantics), and max_findings (default 25, minimum 1, truncation reporting).

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?

The first line states a specific verb and resource: scan a local directory for consequential writes, and flags that it makes no gate call. 'LOCAL-ONLY: never calls the Writ gate, needs no API key, never rewrites files' effectively separates it from the gate-based tools in the family, though no sibling is named explicitly.

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?

It gives clear context: in-process local scan with no gate call and no API key, plus a concrete prerequisite (pywrit installed in the same environment, polyglot extra for TS/JS/Go). It does not state explicit when-not or name an alternative tool to use instead, so it stops short of a 5.

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