Skip to main content
Glama

find_in_file

Read-onlyIdempotent

Find literal text in a server file and return bounded, line-numbered excerpts with context to locate sections before chunked reading or exact replacement. Does not use regex or modify files.

Instructions

Find literal text in a server file and return bounded, line-numbered excerpts. Use to locate relevant sections before chunked reading or exact replacement; this is not regex search and makes no changes.

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>",
      "query": "<query>"
    },
    "name": "find_in_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath in the selected server filesystem, starting from its root.
queryYesLiteral text to find; regular expressions are not supported.
server_idNoWisp server ID. Omit to use the configured WISP_SERVER_ID default.
max_matchesNoMaximum matching excerpts to return.
context_linesNoLines of context to include before and after each match.
case_sensitiveNoWhether query matching should preserve letter case.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv1.4.2
    • addedInput schema / properties / case_sensitive / description
      Added value: +"Whether query matching should preserve letter case."
    • addedInput schema / properties / context_lines / description
      Added value: +"Lines of context to include before and after each match."
    • addedInput schema / properties / context_lines / maximum
      Added value: +10
    • addedInput schema / properties / context_lines / minimum
      Added value: +0
    • addedInput schema / properties / max_matches / description
      Added value: +"Maximum matching excerpts to return."
    • addedInput schema / properties / max_matches / maximum
      Added value: +20
    • addedInput schema / properties / max_matches / minimum
      Added value: +1
    • addedInput schema / properties / path / description
      Added value: +"Path in the selected server filesystem, starting from its root."
    • addedInput schema / properties / query / description
      Added value: +"Literal text to find; regular expressions are not supported."
    • addedInput schema / properties / query / maxLength
      Added value: +500
    • addedInput schema / properties / query / minLength
      Added value: +1
    • addedInput schema / properties / server_id / description
      Added value: +"Wisp server ID. Omit to use the configured WISP_SERVER_ID default."
  2. First observedv1.4.1

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety is covered; "makes no changes" largely restates that. The description does add that matching is literal-only and that output is line-numbered and bounded, but bound values and case behavior live in the schema and the return shape is covered by the output schema, leaving only modest added behavioral context.

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, zero filler, with the core purpose front-loaded ahead of the usage and exclusion clauses. Every clause carries distinct information.

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 six fully documented parameters, full annotation coverage and an output schema, the description covers what an agent needs to select and call it: purpose, use case, literal-only semantics and non-mutation. The only thin spot is the multi-server dimension of server_id, which the schema already handles.

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 description coverage is 100%, so the baseline is 3, and the description reinforces the key semantic constraint that query is literal text rather than a pattern. It adds nothing about the server_id default, max_matches ceiling, or context_lines effect, but the schema already documents those thoroughly.

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 (find literal text in a server file) plus the shape of what comes back (bounded, line-numbered excerpts). It also draws explicit boundaries against regex search and against the read/replace workflows, so an agent can place it among siblings like read_file_chunk and replace_in_file without opening schemas.

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

Usage Guidelines4/5

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

"Use to locate relevant sections before chunked reading or exact replacement" gives a clear when-to-use condition, and "this is not regex search" supplies an explicit exclusion. It stops short of naming the alternative tools directly or stating what to do if no literal match exists, so it is clear context rather than a full routing rule.

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