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)")
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"identifier": "<identifier>",
"query": "<query>"
},
"name": "get_snippets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes | ||
| query | Yes |