Skip to main content
Glama

scan_directory_tool

Scan a local dataset or model directory to detect PII and secrets before publishing. Get a clear report of what personal data it contains to avoid leaks.

Instructions

Recursively scan a local dataset or model directory for PII and secrets before you publish it.

Call this before releasing, uploading, or sharing a dataset/model directory whenever you need to know what personal data it contains -- it is the read-only first step agents should take ahead of redact_directory_tool or package_release_tool, and the right choice on its own when you only need a report, not a redacted copy. Do not call it on directories you do not have read access to, or expect it to catch anything beyond what Presidio's own recognizers detect (no custom regex or heuristics are layered on top).

path must be a directory (or single file) that already exists on disk and is readable by the current process; it walks CSV, JSON/ JSONL, and plain-text files under it. This call is read-only: it never writes, moves, or deletes anything, makes no network requests (Presidio and spaCy run entirely locally), and is safe to call repeatedly -- re-running it against an unchanged directory returns the same findings. On a missing path, or any internal failure, it returns {"error": ..., "error_type": ...} instead of raising or crashing the server -- check for an error key before reading findings.

spacy_model selects the spaCy model Presidio's NLP engine uses (defaults to en_core_web_sm; must already be installed via python -m spacy download <model>, this tool does not install one). score_threshold (0.0-1.0, default 0.35) drops any finding below that Presidio confidence score -- raise it to cut false positives, lower it to widen recall. Example calls: scan_directory_tool(path="./data"), scan_directory_tool(path="./data", score_threshold=0.5), scan_directory_tool(path="./models/card-dir", spacy_model="en_core_web_lg").

Returns a JSON object with root_path, files_scanned, files_skipped, findings (a list of objects each with file_path, entity_type, start/end offsets, score, text_preview, line_number, field_name, detector), entity_counts (per-type totals), total_findings, detector_name, and language. For flag-level detail beyond this docstring, run the equivalent CLI form: releaseguard scan --help.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
spacy_modelNo
score_thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description carries the full burden. It thoroughly discloses behavior: read-only, no network requests, safe to call repeatedly, deterministic results, returns an error object instead of raising on missing paths, and explains limitations (no custom regex). It also details file types scanned and running entirely locally.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While long, every sentence adds value. The structure logically moves from purpose to usage guidelines, parameter semantics, examples, and return format. It is front-loaded with the essential purpose and then provides comprehensive yet non-redundant details.

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?

The description covers not only the three parameters but also error handling, return schema, and behavioral guarantees. It references the sibling tools and provides additional CLI help for deeper detail. Given no annotations and a simple output schema, this is fully complete for an agent to use correctly.

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 compensates fully. Each parameter is explained in detail: path conditions and file types, spacy_model defaults and installation requirement, and score_threshold range and effect on false positives/recall. Example calls illustrate usage.

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+resource: 'Recursively scan a local dataset or model directory for PII and secrets before you publish it.' It clearly distinguishes from siblings by positioning itself as the read-only first step ahead of redact_directory_tool or package_release_tool, and explicitly states when it is the right standalone choice (for a report only).

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?

It provides explicit when-to-use guidance: 'Call this before releasing, uploading, or sharing a dataset/model directory' and contrasts with siblings. It also includes exclusions: 'Do not call it on directories you do not have read access to, or expect it to catch anything beyond what Presidio's own recognizers detect.'

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RudrenduPaul/ReleaseGuard'

If you have feedback or need assistance with the MCP directory API, please join our Discord server