Skip to main content
Glama

zim_links

Read-only

Find links for a ZIM article: outbound links it contains, inbound pages linking to it, or related-article suggestions by link overlap.

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

TableJSON Schema
NameRequiredDescriptionDefault
kindNointernal
limitNo
cursorNo
offsetNo
directionNooutbound
entry_pathYes
zim_file_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.2.5

TDQS

A5/5.0
Behavior5/5

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

The description discloses pagination behavior, occurrence-level vs deduplicated responses, duplicate handling, anchor-link counting, and error conditions. It also explains sidecar requirements and cursor validation, far exceeding what the readOnlyHint annotation provides. No contradiction exists between description and annotations.

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 every sentence carries operational weight, with clear headers for directions, parameters, response, and errors. It is front-loaded with the purpose and direction extraction guidance, making the most critical routing information immediately available. The length is justified by the tool's complexity.

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?

Despite having no output schema, the description documents the response shapes and semantic differences between LinksResponse and RelatedArticlesResponse. It also covers all error paths and parameter constraints, so an agent has everything needed to invoke correctly. Sibling context is not required because the description is self-contained.

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%, but the PARAMETERS section fully compensates. It explains each parameter's role, defaults, valid ranges, and interdependencies, such as kind being outbound-only and offset being rejected for related. This adds significant meaning beyond the raw input 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 opens with a specific verb and resource: 'Look up links from one article' and immediately distinguishes the three buckets (outbound/inbound/related). It also provides alias phrasing so an agent can map user intent to the exact call. This clearly sets it apart from sibling tools like zim_get or zim_search.

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?

It gives explicit direction-level guidance with aliases and tells the agent to route through this tool when the user asks about links, linkers, or related articles. It also states per-direction constraints such as inbound requiring the link-graph sidecar, and related having no pagination. This is comprehensive routing guidance.

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