Skip to main content
Glama

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/kindinvalid_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. 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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains pagination, ranking, sidecar requirements, error conditions, response structure, and even edge cases like anchor link handling. It also documents the sidecar prerequisite for inbound queries, which is critical operational knowledge.

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?

Although long, the description is well-structured with clear headers (EXTRACT, ALIASES, DIRECTIONS, PARAMETERS, RESPONSE, ERRORS) and front-loaded purpose. Every sentence adds value, and the length is justified by the tool's complexity. There is no redundancy or fluff.

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 tool's complexity (7 parameters, 3 directions, pagination, sidecar dependency, error handling) and lack of annotations or output schema, the description is exceptionally complete. It covers response formats, error codes, pagination behavior, and even specific edge cases like anchor links and cursor mismatches. Nothing essential is missing for an agent to invoke it correctly.

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?

The description's PARAMETERS section elaborates on every parameter beyond the schema, including direction, kind, cursor, limit, offset, and default values. It explains constraints like 'related rejects offset' and 'kind is outbound only', which the schema does not convey. Given 0% schema coverage, this is essential and well-executed.

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 states a specific verb ('Look up') and resource ('links from one article'), and clearly delineates three distinct directions (outbound, inbound, related) that distinguish it from sibling tools like zim_search or zim_get. The purpose is unambiguous and unique among the sibling set.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit aliases and routing instructions ('Route through THIS tool with the matching direction'), giving clear context for when to use it. However, it does not explicitly mention alternatives or when not to use it, such as comparing to zim_search for full-text queries. This is a minor gap since the aliases effectively define the trigger conditions.

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