zim_links
Fetch outbound, inbound, or related-article links from a ZIM archive. Specify direction and link kind to get paginated results or ranked related suggestions.
Instructions
Look up links from one article — outbound/inbound link buckets or related-article suggestions.
EXTRACT the direction before calling: "outbound" = the article's
own links (internal / external / media buckets); "inbound" = pages
that link TO it; "related" = "see also" by outbound-link overlap.
ALIASES: "links in " / "what does link to" (outbound); "what links here" / "pages linking to " (inbound); "related to " / "articles like " (related). Route through THIS tool with the matching direction.
DIRECTIONS:
"outbound" (default) — paginated.
"inbound" — ranked by linker importance; paginated. Requires a
built link-graph sidecar (openzim-mcp build link-graph).
"related" — one ranked set (no pagination).
PARAMETERS:
zim_file_path REQUIRED. The archive containing the article.
entry_path REQUIRED. The article whose links to inspect.
direction See DIRECTIONS above.
kind Outbound only — others reject it. Which bucket:
"internal" (default) / "external" / "media". One
per call; category_totals reports four counts.
cursor Cursor handle (outbound/inbound).
limit Page size. Outbound 1-500 (default 100);
inbound and related 1-100 (default 10).
offset Offset (outbound/inbound; related rejects it).
RESPONSE:
LinksResponse (outbound) or RelatedArticlesResponse (inbound /
related). Outbound is occurrence-level (document order, duplicates
kept; total counts them). url is the raw href; internal rows
add path, the entry path for zim_get. Related dedupes targets
and reports mention_count.
category_totals.internal excludes #anchor links (counted as
category_totals.anchor) and anchor-wrapped assets, which move to
the media bucket as type: "asset" (or fold into the <img> row
for the same entry, which then carries path).
ERRORS:
Bad direction/kind → invalid_argument (enum-typed, so it is
rejected before the body runs). Missing/stale inbound sidecar →
inbound_sidecar_unavailable. Unknown entry_path →
not-found envelope (related: outbound_error, total: 0).
Cursor from another archive/entry/tool →
cursor_context_mismatch / cursor_mismatch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | internal | |
| limit | No | ||
| cursor | No | ||
| offset | No | ||
| direction | No | outbound | |
| entry_path | Yes | ||
| zim_file_path | Yes |