Skip to main content
Glama
GigantesHJI

securedact-mcp

securedact_read_file

Read a local file and return sanitized (PII/secrets removed) text for external AI, with defenses against path traversal and sensitive paths.

Instructions

Safely read a local file and return only its sanitized (PII/secrets removed) text.

Use this when you must ingest a local file's contents for use with an external AI but want path-traversal, size, and binary defenses plus sanitization applied first. If the content is already in memory, use prepare_for_external_ai; for a sanitized file on disk, use create_safe_copy.

Side effects: reads a file from local disk and never transmits it. Sensitive paths and escapes are blocked before any file content is read. The returned 'sanitized_text' is safe to forward.

Returns a JSON object with 'status' ('ok' or 'blocked'), 'path', and 'sanitized_text' (present only when approved).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesLocal filesystem path to read. It is resolved and defended against path traversal, symlink/UNC escapes, and oversized or binary content (FW-011/012/013); sensitive paths are blocked before any file content is read.
policyNoNamed redaction policy applied to the file contents. Defaults to 'strict_external_ai'. An unknown name returns a policy_not_found error.strict_external_ai
max_bytesNoOptional cap on the number of bytes read from the file. When omitted, the engine's configured size limit applies.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.2

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description fully owns behavioral disclosure. It spells out side effects (reads file, never transmits), the defense order (sensitive paths and escapes blocked before reading), and the return structure. It even notes sanitized_text is safe to forward. This is thorough and anticipates an agent's security and safety questions.

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 well-structured: purpose sentence, usage trigger, alternatives, side-effects, and return format. Every sentence serves a distinct function with no redundancy. The most important info (what it does and when to use it) is front-loaded.

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?

Given the output schema is present, all return fields are covered. The description addresses security, policy defaults, size limits, and side effects. There is nothing an agent needs to know to call this tool correctly that is missing or ambiguous.

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 the schema already documents all three parameters. The tool description itself does not add new meaning beyond what's in the schema, but it does echo the security posture (e.g., path defenses). Baseline 3 is appropriate because the schema carries the load and the description adds no extra helpful nuance.

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: 'Safely read a local file and return only its sanitized text.' It clearly distinguishes from siblings by naming prepare_for_external_ai (in-memory content) and create_safe_copy (sanitized file on disk), so the agent can immediately tell which tool to use.

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 explicitly states the condition for use: 'when you must ingest a local file's contents for use with an external AI' and gives two alternatives with the contexts under which those would be preferred. This is direct routing guidance.

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