Skip to main content
Glama

search_text

Find specific text within PDF documents by searching with case-insensitive queries and retrieving results with page numbers and surrounding context.

Instructions

Search for text in a PDF file (case-insensitive).

Returns a list of hits with page number and surrounding context.

Args:
    filename: Path to a PDF file.
    query: Text to search for.
    context_chars: Characters of context to include around each hit. Default 100.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes
queryYes
context_charsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It successfully discloses that the search is case-insensitive and describes the return structure ('list of hits with page number and surrounding context'). It misses edge case handling (empty results, malformed PDFs) but covers the essential behavioral contract.

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?

The description is well-structured with the purpose first, followed by return value summary, then the Args section. While the Args section adds length, it is necessary given the 0% schema coverage and follows standard documentation conventions. No sentences appear wasted or redundant.

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?

Given that an output schema exists, the brief summary of return values is sufficient. All three parameters are documented despite poor schema coverage. For a straightforward search utility with obvious read-only semantics, the description provides adequate context for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% (only titles provided). The description fully compensates by documenting all three parameters in the Args section: filename as 'Path to a PDF file', query as 'Text to search for', and context_chars with both semantics and default value. This is exemplary compensation for schema deficiencies.

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 clearly states the action ('Search for text'), the resource ('in a PDF file'), and a key behavioral trait ('case-insensitive'). The 'search' verb effectively distinguishes this from sibling 'get_' tools that extract content by location rather than content matching.

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

Usage Guidelines3/5

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

While the purpose is clear, the description provides only implied usage guidance based on the verb 'search' versus siblings' 'get' operations. It does not explicitly state when to use this versus get_page_text (e.g., 'use this when looking for specific text across the document, use get_page_text to extract all text from a specific page').

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/I-CAN-hack/pdf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server