Skip to main content
Glama
nestordemeure

gallica-mcp

get_snippets

Retrieve text excerpts showing where your search terms appear in a Gallica document, with page numbers for precise content location.

Instructions

Fetch text snippets showing where search terms appear in a Gallica document.

Uses the ContentSearch API to find and return text excerpts with page numbers. This is useful for locating specific content within a document after searching.

Args: identifier: Gallica ARK identifier (e.g., 'ark:/12148/bpt6k5619759j') query: Search terms to find in the document. Supports the same syntax as search_gallica: - Simple text: "Houdini" or "magic tricks" - Exact phrases: '"Harry Houdini"' - Boolean operators: "magic AND illusion", "Houdini OR Houdin" - Complex queries: '("Harry Houdini" OR "Jean Houdin") AND escape'

Returns: Dictionary containing: - identifier: The document ARK identifier - query: The search query used - snippets: List of text excerpts with: - text: Snippet text showing search terms in context - page: Page identifier (e.g., "PAG_200" for page 200)

Examples: # Get snippets for a specific document get_snippets("ark:/12148/bpt6k5619759j", "Houdini")

# Find exact phrase occurrences
get_snippets("ark:/12148/bpt6k5619759j", '"Harry Houdini"')

# Complex query
get_snippets("ark:/12148/bpt6k5619759j", "magic AND (illusion OR escape)")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYes
queryYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the underlying API (ContentSearch), specifies output structure with snippets and page numbers, and does not suggest any destructive behavior. No contradictions.

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?

Description is well-structured with a clear purpose sentence, usage context, parameter docs, return structure, and examples. Slightly verbose for a simple tool, but each sentence adds value. Front-loaded with purpose.

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?

Given no output schema, the description thoroughly explains the return dictionary. It covers purpose, usage context, parameter details, return format, and examples. No gaps for a tool of this complexity.

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 coverage is 0%, but the description adds extensive meaning for both parameters: identifier is explained with an example ARK, query is described with full syntax and examples including exact phrases and Boolean operators. This far exceeds the schema's minimal definition.

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?

Description explicitly states the tool fetches text snippets for search terms in a Gallica document, using a specific verb and resource. It distinguishes from siblings by mentioning it is useful after searching (complementing search_gallica) and its output includes page numbers, unlike download_text which likely returns full text.

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?

Description provides context that the tool is for locating specific content after searching, and details query syntax matching search_gallica. However, it does not explicitly state when to use alternatives like download_text or when not to use the tool.

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/nestordemeure/gallica-mcp'

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