Skip to main content
Glama
cyberdroid2077

opsecforge-mcp

Redact a local file

redact_file
Read-onlyIdempotent

Read local text files, replace secrets like API keys, tokens, passwords, and keys with [REDACTED], and return a findings summary to keep sensitive values out of model context.

Instructions

Reads a local text file on this machine and returns its content with secrets (API keys, tokens, passwords, private keys, connection-string credentials, JWTs, cookies) replaced by [REDACTED], plus a findings summary (type, count, line numbers). The original values are read inside the local MCP server process only and are never returned, so use this instead of Read or cat for .env files, config files, logs, key files and similar. Pass a path, not file contents. Only regular files are accepted (no directories, pipes or devices), up to 1 MiB, and binary files are refused. The response starts with a notice that the original values did not leave the machine or reach the model. Redaction is heuristic and can miss custom formats.

Input Schema

NameRequiredDescriptionDefault
pathYesPath of the local text file to read (absolute, relative to the server working directory, or starting with ~/).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, yet the description adds genuinely new behavior: originals are read only inside the server process and never returned to the model, a notice is prepended to the response, size and file-type limits apply, and redaction is heuristic and may miss custom formats. These are exactly the traits annotations cannot express.

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?

Front-loads what the tool does and its safety guarantee before constraints and caveats. Every sentence carries distinct information (output shape, routing, limits, honesty about heuristic gaps); nothing is redundant padding.

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?

With no output schema, the description still describes the return value (redacted content plus findings summary and a leading notice), covers the input contract, failure modes (binary, oversized, non-regular files), and the security-relevant limitation of heuristic redaction. Nothing an agent needs to call it correctly is missing.

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 coverage is 100% and the single path parameter is already documented with accepted path forms, so the baseline is 3. The description adds real value by clarifying that a path (not file contents) must be passed and that only regular files within 1 MiB are accepted, tightening how the parameter is supplied.

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?

States a specific verb and resource (reads a local text file and returns content with secrets replaced by [REDACTED]) plus the secondary output (findings summary with type, count, line numbers). It also implicitly separates itself from the sibling redact_text by specifying 'Pass a path, not file contents' and from Read/cat by naming them directly.

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?

Explicitly says when to use it ('use this instead of Read or cat for .env files, config files, logs, key files') and enumerates when not to (directories, pipes, devices, binary files, files over 1 MiB). The 'pass a path, not file contents' clause routes the agent away from the text-based sibling.

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