Skip to main content
Glama

search_document

Searches text inside PDF, Word, Excel, or CSV files and returns matching page numbers with surrounding context, so long documents can be located without reading them in full.

Instructions

在文档里搜索文本,返回命中的页码和上下文。长文档不必整份读进来,先用它定位。

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

Input Schema

NameRequiredDescriptionDefault
pathYes文档路径
limitNo最多返回多少条命中
queryYes要查找的文本,不区分大小写
context_charsNo命中处前后各保留多少字符

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations exist, so the description must carry behavioral burden. It discloses the useful traits that this is a locating read and that hits come back with page number plus surrounding context, but it says nothing about no-hit behavior, coverage of the whole document, or ordering of results.

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 short sentences, purpose first, usage rationale second — zero padding.

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 an output schema present, return values need not be explained, and the description covers purpose plus the key usage decision. What remains thin is behavioral disclosure (no hits, ordering), which is modest for a read-only search tool.

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 limit, query, context_chars, and path are already documented in the schema (including case-insensitivity). The description adds no syntax or defaulting detail beyond that, which is the expected baseline here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ("在文档里搜索文本") and the returns ("命中的页码和上下文"), which distinguishes it from a full-read sibling without naming one. It stops short of naming read_document/inspect_document explicitly, so it is clear but not sibling-routing.

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?

Gives a concrete when-to-use: for long documents, locate first rather than loading the whole file ("长文档不必整份读进来,先用它定位"). The alternative (reading in full) is implied rather than named, and there is no explicit when-not guidance.

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