Skip to main content
Glama

zim_search

Search offline Wikipedia and knowledge bases in ZIM archives using full-text, title, or autocomplete modes. Retrieve relevant results from single or multiple archives with filters.

Instructions

Search a ZIM archive — three modes, one tool.

EXTRACT the search intent before calling. Pick the mode that matches what the user actually needs; the wrong mode silently returns the wrong shape of results.

MODES (pass one as mode):

  • "fulltext" (default) — Xapian BM25 search with optional namespace / content_type filters. Use for queries with multiple keywords ("history of Rome", "Tesla electricity") or when the caller wants snippets, not just titles. Cross-archive via cross_file=True.

  • "title" — Exact / typo-tolerant title lookup. Returns titles matching the query (case ladder + suggestion expansion + Levenshtein-1). Use when the caller knows the article name and wants to confirm it exists or find near matches ("find article titled Detroit"). Single-archive applies Z3/Z4/OPP-1 promotion; cross-archive (cross_file=True) returns raw matches without promotion (promotion is per-archive).

  • "suggest" — Prefix autocomplete via libzim SuggestionSearcher. Returns title candidates only — no snippets, no body. Use for typeahead-style completion ("prefix Det"). Does NOT support cross_file=True (libzim's SuggestionSearcher is per-archive).

ALIASES: callers may say "search", "find", "lookup", or "autocomplete". All route through THIS tool — pick the matching mode.

PARAMETERS: query REQUIRED. Plain terms; AND/OR/NOT, quotes and wildcards are not parsed (matched as literal words). mode One of {"fulltext", "title", "suggest"}. Default "fulltext". zim_file_path Optional. Omit to auto-select the single loaded archive, or use cross_file=True to fan out. cross_file Default False. Set True to fan out across every loaded archive (modes "fulltext" and "title" only; "suggest" rejects this with invalid_combination). namespace Only valid in mode="fulltext". Restricts search to one ZIM namespace letter (e.g. "C" for content). Rejected in title/suggest modes. content_type Only valid in mode="fulltext". Restricts search to one MIME bucket (e.g. "text/html"). limit Max results; cap 50 title/suggest/cross_file, 100 filtered, else 1000. offset Pagination offset (default 0); single-archive fulltext only. Next page: offset + page_info.source_consumed (else returned_count). cursor Unsupported; page fulltext via offset.

RESPONSE: fulltext rows carry path, title, snippet; title rows carry path, title, score — pass path as entry_path to zim_get. cross_file=True nests hits under results[].result.results. suggest items are {text, path, type}. Title-mode _meta.promotion_applied is True when a candidate was hoisted; False with a hint when cross-archive blocked it.

ERRORS: Returns a ToolErrorPayload on: - mode="suggest" with cross_file=True (invalid_combination) - limit out of range, negative offset (invalid_limit, invalid_offset) - missing archive when zim_file_path is required but cross_file is False and auto-selection fails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNofulltext
limitNo
queryYes
cursorNo
offsetNo
namespaceNo
cross_fileNo
content_typeNo
zim_file_pathNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv3.2.5

TDQS

A4.8/5.0
Behavior5/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 of behavioral disclosure. It thoroughly explains mode behaviors, result shapes, error conditions, pagination semantics (offset and source_consumed), promotion flags, and unsupported cursor. It even warns about silent wrong-shape results and cross_archive blocking. This is comprehensive transparency.

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?

The description is long but exceptionally well-structured with clear headings (MODES, PARAMETERS, RESPONSE, ERRORS) and is front-loaded with the critical instruction to extract search intent and pick the correct mode. Every sentence provides necessary information—no filler or redundancy. It is appropriately sized for a tool with three modes and nine parameters.

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 complexity (3 modes, 9 parameters, no output schema), the description is complete. It covers all modes, all parameters, response formats for each mode, error handling, pagination, cross_archive behavior, and even how to use results with zim_get. An agent can call this tool correctly without needing additional information.

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 description coverage is 0%, so the description must fully explain parameters. It does so in a dedicated PARAMETERS section, detailing every parameter (query, mode, zim_file_path, cross_file, namespace, content_type, limit, offset, cursor) with constraints, defaults, and mode-specific validity. It even explains how offset and page_info interact. This fully compensates for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches a ZIM archive with three distinct modes (fulltext, title, suggest), making its primary purpose unambiguous. However, it does not explicitly differentiate from sibling tools like zim_query or zim_get; the name itself is the main differentiator. It is specific about the resource and action, but lacks explicit sibling comparison.

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 gives explicit guidance on when to use each mode, with examples ('Use for queries with multiple keywords...', 'Use when the caller knows the article name...'), and warns that the wrong mode silently returns the wrong shape of results. It also provides aliases and clarifies mode-specific restrictions (e.g., suggest does not support cross_file). This is exemplary usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/cameronrye/openzim-mcp'

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