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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| page | No |