Skip to main content
Glama

Get link graph

get_graph
Read-onlyIdempotent

Map page links in a wiki space as nodes and edges, optionally limited to a page's neighborhood, to reveal hubs, clusters, and connection paths for content analysis.

Instructions

Returns the link graph of one space as nodes and edges, from pages the caller can see: each node is a page (id, title, kind, path, tags, degree = distinct neighbours) and each edge a link source -> target with its count. With page, only that page and the pages within depth link hops of it (1-3, default 1), following links out of it, into it, or both. Optional nodes: tags (page -> tag edges), files (attachments linked from pages), unresolved (link targets that do not exist). Use it to find hub pages, clusters and how pages connect; read_page a node id for its content. Pages beyond limit (default 300) are left out, most recently changed kept, and truncated says so.

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": {
      "space": "<space>"
    },
    "name": "get_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoPage id: return only its neighbourhood
tagsNoInclude tags as nodes (default false)
depthNoLink hops from page, 1-3 (default 1)
filesNoInclude linked space files as nodes (default false)
limitNoMaximum number of pages (1-2000, default 300)
spaceYesSpace slug
orphansNoKeep pages without links (default true)
directionNoWith page: follow links out of it, into it, or both (default)
unresolvedNoInclude link targets that do not exist (default false)

Output Schema

NameRequiredDescriptionDefault
edgesYesLinks between the nodes, source -> target
limitYes
nodesYesPages the caller can open, plus tag, file and unresolved nodes when asked for
centerNoThe page the neighbourhood is around
truncatedYesTrue when pages were left out because of the limit
totalPagesYesReadable pages in scope before the limit

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, yet the description adds real context: results are visibility-scoped, limit defaults to 300 and drops the least recently changed pages, and truncation is reported. It stops short of describing edge weights beyond 'count' or ordering details, but covers the operational caveats an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One dense paragraph that front-loads the return shape, then page/depth scoping, then optional node types, then truncation policy. Every sentence carries information, though packing nodes, edges, and degrees into one sentence makes it slightly heavy to scan.

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?

Covers the elements that matter for a graph query: visibility scope, depth semantics, optional node kinds, default limit and truncation behavior. With an output schema present, no explanation of raw return values is needed and none is wasted.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so a baseline 3 applies, and the description still adds consequences: depth means link hops out of, into, or both from the given page; page scoping limits the graph to that neighbourhood; tags/files/unresolved change node types rather than filters. Only orphans and the precise limit range are left to schema alone.

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?

States a precise verb+resource+scope: 'Returns the link graph of one space as nodes and edges, from pages the caller can see', then defines what a node and an edge are. An agent can tell it apart from backlink or orphan listing tools without opening the schema.

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?

Gives an explicit use case ('find hub pages, clusters and how pages connect') and routes content retrieval to read_page. It does not explicitly exclude get_backlinks or list_orphans, so guidance is clear but not fully comparative.

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