Skip to main content
Glama

wps_word_find_in_document

Read-onlyIdempotent

Find specific text in Word documents and return character positions, paragraph index, and nearby context. Read-only operation—does not replace text.

Instructions

在Word文档中查找文本并返回位置信息,不执行替换操作。

使用场景:

  • "找一下'项目名称'在文档的哪个位置"

  • "看看文档里有哪些地方需要填写"

  • 在使用smart_fill_field之前,先用此工具定位关键字

返回信息包括:匹配文本、字符起止位置、所在段落索引、上下文(前后50字符)。 与find_replace不同,此工具仅查找不替换,返回位置信息供后续操作使用。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
find_textYes要查找的文本
match_caseNo是否区分大小写,默认false
max_resultsNo最大返回结果数,默认20
match_whole_wordNo是否全字匹配,默认false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-hardened.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint false. The description adds meaningful behavioral detail beyond that: no replacement is performed, and the returned information includes match text, character offsets, paragraph index, and 50-character 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?

The description is front-loaded with the core purpose, followed by useful usage scenarios and return-value details. It is well-structured with no filler and every sentence contributes to correct tool selection and invocation.

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?

With no output schema, the description compensates by explaining the return contents. The annotations cover safety and idempotency, the schema documents all parameters, and the description covers purpose, usage, and differentiating behavior. The agent has enough to invoke the tool correctly.

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 parameters are already fully documented in the schema. The tool description adds usage context but no additional parameter-level semantics, so the baseline 3 is appropriate.

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 states a specific action ('在Word文档中查找文本') and a concrete result ('返回位置信息'), and explicitly distinguishes the tool from find_replace by noting it does not replace. This makes selection among the sibling word tools unambiguous.

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?

The description provides concrete user-intent examples, positions the tool as a prerequisite before smart_fill_field, and explicitly contrasts it with find_replace. This is clear when-to-use and when-not-to-use guidance.

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