Skip to main content
Glama

Search

redctx_search
Read-onlyIdempotent

Find lines in redacted project context matching a literal substring or Python regex, returning grep-style results with optional surrounding context lines.

Instructions

Find lines of redacted text containing query (a literal substring, or a Python regex with regex) and return grep-style lines @p_<id>:<line>:<redacted path>:<text> (context lines use - after the id), or No matches.. Use it for exact words, identifiers or patterns and to see nearby lines; use redctx_retrieve instead for ranked passages answering a multi-word question. Matching runs on redacted output, so raw sensitive values never match; search for a placeholder such as [PERSON_<hex>] copied from earlier output to find every mention of that exact value. Forms the operator declared as aliases of one entity share its hex and add a form suffix, as in [PERSON_<hex>.<form>] or [EMAIL_<hex>.<form>]: search for [PERSON_<hex> without the closing bracket to find every person-typed form, or for the bare <hex> to find every form. Output stops at max_results lines with [TRUNCATED]; the call fails after 30 s, when a file in scope exceeds the server's per-file byte limit (5 MB by default), or when the scope exceeds its total byte limit (50 MB by default), so narrow paths or glob on large roots.

Input Schema

NameRequiredDescriptionDefault
globNoShell-style patterns matched against each file's root-relative path, for example `*.md` or `notes/*.txt`; a file is kept if it matches any pattern. `*` also matches `/`, so `*.md` matches at every depth. Default `[]` means no filter. Applied within `paths`.
pathsNoFiles or directories to include: root-relative paths or `@p_<id>` references from earlier output. Directories are walked recursively, skipping excluded, protected, symlinked and binary files. Default `[]` means the whole root. With `glob`, only files under these paths that also match a glob are used.
queryYesText to find within a single line of redacted output: a literal substring, or a regex when `regex` is true. May be a placeholder copied from earlier output.
regexNoTreat `query` as a Python regular expression matched per line. Default false. Invalid patterns fail with `Invalid regex.`; patterns prone to catastrophic backtracking, such as nested quantifiers, are rejected.
contextNoLines to include before and after each match. Default 0. Context lines count toward `max_results`.
ignore_caseNoMatch case-insensitively, for literal and regex queries alike. Default true.
max_resultsNoMaximum output lines (matches plus context lines) before the output stops with `[TRUNCATED]`. Default 200.

Output Schema

NameRequiredDescriptionDefault
textYesThe tool output, identical to the text content block and already redacted: sensitive values appear as deterministic `[CATEGORY_<hex>]` placeholders (forms declared as aliases of one entity share its hex and add a form suffix, `[CATEGORY_<hex>.<form>]`) and files as `@p_<id>` references. When the result has `isError: true`, this is a fixed error message instead, such as a limit error or the notice that context access is blocked until the operator repairs the local redaction config.
receiptYesRedaction statistics for this call only; never contains original values.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv0.10.0
    • addedInput schema / properties / context / description
      Added value: +"Lines to include before and after each match. Default 0. Context lines count toward `max_results`."
    • addedInput schema / properties / glob / description
      Added value: +"Shell-style patterns matched against each file's root-relative path, for example `*.md` or `notes/*.txt`; a file is kept if it matches any pattern. `*` also matches `/`, so `*.md` matches at every depth. Default `[]` means no filter. Applied within `paths`."
    • addedInput schema / properties / ignore_case / description
      Added value: +"Match case-insensitively, for literal and regex queries alike. Default true."
    • addedInput schema / properties / max_results / description
      Added value: +"Maximum output lines (matches plus context lines) before the output stops with `[TRUNCATED]`. Default 200."
    • changedInput schema / properties / paths / description
      Previous value: -"Paths or @p_<id> references to search. Empty searches the root."New value: +"Files or directories to include: root-relative paths or `@p_<id>` references from earlier output. Directories are walked recursively, skipping excluded, protected, symlinked and binary files. Default `[]` means the whole root. With `glob`, only files under these paths that also match a glob are used."
    • addedInput schema / properties / query / description
      Added value: +"Text to find within a single line of redacted output: a literal substring, or a regex when `regex` is true. May be a placeholder copied from earlier output."
    • addedInput schema / properties / regex / description
      Added value: +"Treat `query` as a Python regular expression matched per line. Default false. Invalid patterns fail with `Invalid regex.`; patterns prone to catastrophic backtracking, such as nested quantifiers, are rejected."
    • addedOutput schema / description
      Added value: +"Structured copy of every tool result: the output text plus a receipt of what redaction did."
    • addedOutput schema / properties / receipt / description
      Added value: +"Redaction statistics for this call only; never contains original values."
    • addedOutput schema / properties / receipt / properties / counts_by_category / description
      Added value: +"Placeholders substituted while producing this result (content and paths), keyed by category such as `PERSON`, `EMAIL` or `SECRET`; categories with none are omitted."
    • addedOutput schema / properties / receipt / properties / detector_profile / description
      Added value: +"Active built-in detector profile: `default`, or `extended`, which adds more identifier types and prompt-injection markers."
    • addedOutput schema / properties / receipt / properties / detectors
      Added value: +{
      +  "description": "Present only when the server runs additional local detectors: one entry per detector, in load order.",
      +  "items": {
      +    "properties": {
      +      "name": {
      +        "description": "Detector name.",
      +        "type": "string"
      +      },
      +      "nominated": {
      +        "description": "Distinct values this detector nominated during the call; every occurrence of each is redacted.",
      +        "type": "integer"
      +      },
      +      "positional": {
      +        "description": "Nominated spans redacted only at their own position, because they were too long or exceeded the per-text value budget.",
      +        "type": "integer"
      +      },
      +      "version": {
      +        "description": "Detector version string.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "version",
      +      "nominated",
      +      "positional"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / text / description
      Added value: +"The tool output, identical to the text content block and already redacted: sensitive values appear as deterministic `[CATEGORY_<hex>]` placeholders (forms declared as aliases of one entity share its hex and add a form suffix, `[CATEGORY_<hex>.<form>]`) and files as `@p_<id>` references. When the result has `isError: true`, this is a fixed error message instead, such as a limit error or the notice that context access is blocked until the operator repairs the local redaction config."
  2. First observedv0.4.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/non-destructive, but the description adds substantial behavior the annotations cannot: matching runs on redacted output so raw values never match, alias hex/form-suffix search semantics, `[TRUNCATED]` cutoff, and three concrete failure modes (30 s timeout, 5 MB per-file, 50 MB scope) with remediation advice.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and output format are front-loaded, then usage routing, then advanced search semantics, then limits/failures — a sensible order. It is dense and long for a single paragraph, but essentially every sentence carries information an agent needs.

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?

An output schema exists, so return values need no further explanation, and the description still covers output shape, truncation, error conditions, and search semantics. Nothing required 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%, so the baseline is 3, but the description adds real meaning beyond the schema for `query` (placeholder copying, `[PERSON_<hex>` prefix trick, bare `<hex>` to catch every form) and links `paths`/`glob` narrowing to the byte-limit failures. It does not re-explain the other parameters, which is appropriate given the schema does so.

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+resource (find lines of redacted text containing `query`) and describes the exact return format (`@p_<id>:<line>:<redacted path>:<text>` or `No matches.`). It explicitly names the sibling it is not (`redctx_retrieve`) and the condition that separates them.

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?

Gives explicit when-to-use ('exact words, identifiers or patterns', 'see nearby lines') and an explicit alternative with its selecting condition ('use `redctx_retrieve` instead for ranked passages answering a multi-word question'). Also tells the agent how to act on results (copy a placeholder from earlier output to find every mention).

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