Skip to main content
Glama

redact_directory_tool

Scan a directory for PII and secrets, then write a redacted copy to a new location without altering the original. Use to sanitize data before sharing or publishing.

Instructions

Scan a directory for PII/secrets with Presidio, then write a redacted copy to a new location.

Call this once you already know (or expect) a directory contains PII and want a sanitized copy you can hand off or publish, without touching the original. It runs its own internal scan first (same detector as scan_directory_tool), so you do not need to call scan_directory_tool beforehand unless you want to inspect findings before deciding to redact. Skip it if you only need a report (use scan_directory_tool) or if you also want the Hugging Face card and EU AI Act summary generated (use package_release_tool, which redacts as one step of a larger bundle).

path must exist and be readable. This tool is mutating but scoped to output only: it never edits, moves, or deletes anything under path. Writing fails if output already exists and is non-empty, unless overwrite=True -- pass that deliberately, since it will silently overwrite prior contents of output. No network calls are made; everything runs locally. Not idempotent across repeated calls with overwrite=True if the source directory changed between runs (the redacted copy reflects whatever path contains at call time).

strategy controls how each finding is replaced: "mask" (default, replaces matched text with a placeholder like <EMAIL_ADDRESS>), "hash" (replaces with a deterministic hash of the original value), or "remove" (deletes the matched span entirely). Example calls: redact_directory_tool(path="./data", output="./data-redacted"), redact_directory_tool(path="./data", output="./data-redacted", strategy="hash"), redact_directory_tool(path="./data", output="./data-redacted", overwrite=True).

Returns a JSON object with source_root, output_root, strategy, files_written (list of paths under output), entities_redacted (per-entity-type counts), and total_redacted. On a missing path, an invalid strategy, or a non-empty output without overwrite=True, it returns {"error": ..., "error_type": ...} instead of raising. See releaseguard redact --help for the CLI-equivalent flag reference.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
outputYes
strategyNomask
overwriteNo

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 fully discloses mutation scope: 'never edits, moves, or deletes anything under path', overwrite semantics, silent overwrite risk, local-only execution, non-idempotency, and error return behavior. This goes well beyond what annotations would provide.

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?

The description is longer than average but every section earns its place: purpose, usage, safety, parameter details, examples, and return format. It is well-structured and front-loaded with the core action, then branches into necessary caveats rather than burying the main point.

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 4-parameter tool with no annotations and no schema descriptions, this description is remarkably complete. It covers sibling alternatives, operation details, failure modes, return value structure, and example calls, leaving almost no ambiguity for an agent.

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 fully compensate. It explains path must exist/readable, output collision/overwrite behavior, strategy values ('mask', 'hash', 'remove') with concrete examples, and overwrite semantics. Example calls demonstrate correct usage for all parameters.

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 and resource: 'Scan a directory for PII/secrets with Presidio, then write a redacted copy to a new location.' It clearly distinguishes itself from siblings by explicitly naming scan_directory_tool for reports and package_release_tool for the full bundle.

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 gives explicit when-to-use guidance ('Call this once you already know...') and when-to-avoid ('Skip it if you only need a report...' or need the Hugging Face/EU AI Act bundle). It also clarifies that a prior scan step is unnecessary, which directly addresses an alternative.

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