Skip to main content
Glama

Redact a file

redact_file

Redacts PII, PHI, and secrets in local files before returning or writing a cleaned copy, preserving JSON/JSONL/CSV structure and keeping raw values out of the conversation.

Instructions

Read a local file inside the server and return/write only its redacted version, so raw contents never enter the conversation. JSON, JSONL and CSV keep their structure; everything else is treated as text.

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": "redact_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoReplacement mode: one of placeholder, synthetic, hash, mask, label. Default: server setting.
pathYesFile to read (inside the allowed directories)
policyNoPolicy pack(s), e.g. 'hipaa', 'dpdp,secrets', 'all,-URL'. Default: server setting.
overwriteNoAllow replacing an existing output file
session_idNoReuse an existing session for consistent tokens. Omit to start a new one.
output_pathNoAlso write the redacted copy here
return_contentNoReturn the redacted content in the result

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, destructiveHint=false and idempotentHint=false, so the description is not the sole source of the safety profile; still, it adds real context beyond them by disclosing that only the redacted version is returned/written and that JSON, JSONL and CSV preserve structure while other formats are treated as text. It does not discuss overwriting existing output files or whether redaction is reversible, which would have completed the picture.

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?

Two sentences with no filler: the core action and its privacy guarantee come first, the format-handling caveat second. Nothing is repeated from the schema or annotations.

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?

With seven well-described parameters and an output schema present, the description carries only the burden of behavior and format semantics, which it does. Minor gaps remain around overwrite semantics and session token reuse, though both are handled by schema descriptions.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all seven parameters (mode, path, policy, overwrite, session_id, output_path, return_content) are already documented in the schema. The description adds only the format-handling behavior, not parameter-specific meaning, so the baseline 3 applies.

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?

States a specific verb chain (read, redact, return/write) and a precise resource (a local file inside the server), plus the constraint that raw contents never enter the conversation. It partially distinguishes itself from siblings such as redact_json by noting that JSON/JSONL/CSV are handled structurally and everything else as text, but it never names an alternative tool outright.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'so raw contents never enter the conversation' implies the motivating use case (redact before exposing file data to the agent), but there is no explicit when-to-use/when-not guidance. It does not say when to prefer the sibling tools redact_json, redact, or scan_files over this one, so the agent must infer routing.

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