Skip to main content
Glama
nestordemeure

gallica-mcp

search_gallica

Search millions of digitized documents from Gallica using text queries with boolean operators and exact phrases. Returns paginated results with metadata.

Instructions

Search Gallica for documents matching a text query.

Searches across OCR content with support for boolean operators and exact phrases. Returns paginated results with metadata. Uses exact matching by default.

Note: To get text snippets showing where your search terms appear within documents, use the get_snippets tool with the document identifier and query.

Args: query: Text to search in OCR content. Supports CQL query syntax: - Simple text: "Houdini" or "magic tricks" (all words must appear, any order) - Exact phrases: '"Harry Houdini"' (use double quotes for exact phrase) - AND operator: "magic AND illusion" (both terms must appear - MUST BE UPPERCASE) - OR operator: "Houdini OR Houdin" (either term can appear - MUST BE UPPERCASE) - NOT operator: "magic NOT card" (first term yes, second term no - MUST BE UPPERCASE) - Parentheses: "(Houdini OR Houdin) AND escape" (group operations for precedence) - Combine all: '"Harry Houdini" AND (escape OR illusion) NOT death'

    Boolean operators (AND, OR, NOT) MUST be UPPERCASE.
    The query is converted to CQL format automatically and searches OCR text content.

page: Page number for pagination, 1-indexed (default: 1)

Returns: Dictionary containing: - page: Current page number - total_results: Total number of matching documents - total_pages: Total number of pages available - documents: List of documents with: - identifier: ARK identifier (use with download_text or get_snippets) - title: Document title - url: URL to view document on gallica.bnf.fr - creators: List of authors/creators - date: Publication date (if available) - type: Document type (e.g., monographie, périodique) - language: Language code (if available)

Examples: # Simple search search_gallica(query="Houdini")

# Exact phrase
search_gallica(query='"Harry Houdini"')

# Boolean operators
search_gallica(query="magic AND illusion")
search_gallica(query="Houdini OR Houdin")
search_gallica(query="magic NOT card")

# Complex query
search_gallica(query='("Harry Houdini" OR "Jean Houdin") AND (escape OR illusion)')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
pageNo
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses that the tool searches OCR content, supports boolean operators and exact phrases, returns paginated results, and uses exact matching by default. It also details the return format and query syntax. It does not mention rate limits, authentication, or performance considerations, but covers core behavior well.

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 clear sections (Args, Returns, Examples). It is longer than average but justified by the complexity of the query syntax and the need for comprehensive documentation. Every sentence adds value without redundancy.

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 the tool's complexity (CQL syntax, pagination, multiple output fields) and no output schema, the description is remarkably complete. It explains the return dictionary structure with all fields, provides multiple usage examples, and mentions sibling tools for related functionality.

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 has only 2 parameters with 0% coverage. The description provides extensive semantics for the query parameter, including CQL query syntax, operators, and examples. The page parameter is briefly explained with default and indexing. This adds substantial meaning beyond the minimal 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 'Search Gallica for documents matching a text query,' specifying the verb (search), resource (Gallica documents), and scope (matching a text query). It distinguishes from siblings by referencing get_snippets for snippet extraction and implying download_text for downloading.

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?

The description explicitly directs when to use get_snippets for text snippets, providing an alternative. However, it lacks an explicit 'when not to use' statement or mentions of prerequisites, though the context is clear enough for adequate decision-making.

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