Skip to main content
Glama

Full-text search across a cached document's extracted text

search_document
Read-onlyIdempotent

Search within a government document for a specific phrase and get matching page numbers with context snippets. Use when document landmarks don't list your target topic. Requires jurisdiction and document ID. Limits to 20 hits by default.

Instructions

Locate pages containing a phrase. Returns matching page numbers + short context snippets for navigation. Useful when the outline/landmarks don't list your target (e.g. you want 'directors' remuneration' but only 'Directors Report' is a landmark). Up to max_hits pages (default 20) are returned; total_hits counts raw matches across the document.

CRITICAL — snippets are NAVIGATION AIDS ONLY and may contain OCR errors. Once you've identified target pages, call fetch_document_pages(pages=) to read the authoritative text / bytes before citing anything.

Requires get_document_navigation (or fetch_document on a PDF) to have run first so the per-page text index exists in R2.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jurisdictionYesISO 3166-1 alpha-2 country code (uppercase). All registries are official government sources. Currently supported: AU, BE, CA, CA-BC, CA-NT, CH, CY, CZ, DE, ES, FI, FR, GB, HK, IE, IM, IS, IT, KR, KY, LI, MC, MX, MY, NL, NO, NZ, PL, RU, TW. Per-country capability, ID format, examples, status mapping, and caveats: call `list_jurisdictions({jurisdiction:'<code>'})`. To find which countries support a specific tool: `list_jurisdictions({supports_tool:'<tool>'})`.
document_idYes
queryYesPhrase to search for. Case-insensitive.
max_hitsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queried_atYesISO-8601 + Europe/London timezone stamp for when the registry was queried.
jurisdictionNo
document_idNo
queryNo
matchesNo
Behavior4/5

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

Annotations already indicate readOnlyHint, destructiveHint false, idempotentHint, openWorldHint. The description adds valuable context: snippets may contain OCR errors and are navigation aids only, and the tool relies on a per-page text index in R2. It does not contradict annotations.

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?

Description is concise with clear structure: purpose sentence, return values, usage hint, critical warning, and prerequisite. Front-loaded with key info. No wasted words.

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?

Tool has 4 parameters, output schema present, good annotations. Description covers purpose, usage, behavioral notes, and prerequisite completely. No gaps for agent to use correctly.

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 50%, so description compensates well. It explains query parameter as case-insensitive phrase search, max_hits default (20) and max (100), and clarifies that total_hits counts raw matches. However, does not elaborate on document_id or jurisdiction beyond schema.

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 tool 'Locate pages containing a phrase' and distinguishes it from navigation landmarks or other document tools. It specifically contrasts with get_document_navigation, which lists landmarks, making the purpose 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 explicitly says when to use: when 'the outline/landmarks don't list your target' and provides a concrete example. It also instructs the agent to call fetch_document_pages afterwards for authoritative text, and specifies a prerequisite: 'Requires get_document_navigation (or fetch_document on a PDF) to have run first'.

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/sophymarine/openregistry'

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