Skip to main content
Glama

airlock_read_file

Read-onlyIdempotent

Read local UTF-8 text files up to 1 MB and replace detected secrets or PII with reversible session placeholders before returning sanitized text; the original file stays unchanged.

Instructions

Read a local UTF-8 text file and replace secrets and PII with reversible <ENTITY_N> placeholders.

Purpose & Behavior:
Reads up to 1 MB of text from `path`, runs two-stage secret/PII detection (deterministic regex plus
contextual NER), stores raw values in the local in-memory session vault, and returns sanitized text
containing session-consistent placeholders such as `<API_KEY_1>`, `<AUTH_TOKEN_1>`, or `<PERSON_1>`.
Does not modify the file on disk.

When to Use:
- Use this instead of native file-read or `cat` commands for `.env`, configuration, log, or source files
  that may contain credentials or PII.
- Pair with `airlock_write_file` to update the file on disk with real secrets automatically restored.
- For in-memory strings rather than files, use `airlock_dehydrate` or `airlock_scrub_text`.

Returns:
A JSON-serializable object with `{"path": str, "sanitized_text": str, "redacted_count": int,
"latency_ms": float, "tokens": list[str]}`. Raises a tool error if the file is missing, binary,
exceeds 1 MB, or violates workspace or system-directory guardrails.

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

Input Schema

NameRequiredDescriptionDefault
pathYesRelative or absolute filesystem path to the UTF-8 text file to read (max 1 MB). Sensitive system directories (.ssh, .aws, .gnupg, .kube, /etc) and binary files are blocked.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.6
    • addedInput schema / properties / path / description
      Added value: +"Relative or absolute filesystem path to the UTF-8 text file to read (max 1 MB). Sensitive system directories (.ssh, .aws, .gnupg, .kube, /etc) and binary files are blocked."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, idempotent, non-destructive), yet the description goes further: two-stage regex plus NER detection, vault storage of raw values in session memory, the explicit guarantee that the on-disk file is untouched, and the precise error conditions (missing, binary, over 1 MB, guardrail violations). That is well beyond what the annotations disclose.

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-loaded summary followed by clearly labelled Behavior, When to Use, and Returns sections, each sentence carrying distinct information. The Returns block is not padding: with no output schema, it is the only place the response shape is documented.

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 single-parameter read tool with no output schema, the definition covers detection behavior, vault side effects, disk immutability, return shape, and failure modes. Nothing an agent needs in order to call it correctly or interpret a failure is missing.

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 coverage is 100% on a single `path` parameter whose description already documents relative/absolute form, the 1 MB cap, and the blocked system directories. The description restates the 1 MB limit and mentions guardrails but adds no new syntax, format, or resolution semantics beyond the schema. Baseline 3 is correct here.

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 opening sentence names a specific verb and resource ('Read a local UTF-8 text file') and adds the defining differentiator, reversible `<ENTITY_N>` placeholder substitution. It is immediately distinguishable from siblings like `airlock_scrub_text` and `airlock_dehydrate` because it operates on files rather than strings.

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 ('instead of native file-read or `cat` for .env, config, log, or source files'), names the in-memory alternatives for the non-file case, and explains the pairing with `airlock_write_file`. Both route-to and route-away conditions are stated, not inferred.

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