Skip to main content
Glama

BYOKG

Relations of a node, summarized

get_node_stats
Read-onlyIdempotent

Summarize one node's relations by type and direction (counts, weights, the strongest partners) without listing every edge; use it before query_graph_neighbors on a node with many edges. Input: node_id (required: this room's opaque node id from search, get_node, explore or paths) and namespace_id; limit sizes the answer. Returns per relation type and direction the count, the weight sum and the limit heaviest relations with the nodes they reach, and with group_by the reached nodes grouped by a second relation. Deterministic, no model call; at most 50,000 edges are read (NEIGHBORHOOD_TOO_LARGE: narrow by relation_types). A node without any edge returns warning ISOLATED_NODE with the reason its record gives (LEMMA_WITHOUT_ROOT). The heaviest relations show the strongest co-occurring roots, or a root's lemmas with their occurrence counts. node_id is the node_id of a search hit or source, or an id from overview, neighbors or paths. group_by groups the nodes one relation reaches by a second relation of theirs: relation_type OCCURS_IN, direction OUT, via_relation_type HAS_AYAH, via_direction IN gives a root's ayahs per surah. relation_types counts only relations of these types (for example CO_OCCURS or OCCURS_IN). Directions are seen from the near node; an undirected edge has no direction and matches OUT and IN. limit is the name every tool uses for the size of its answer (top_n is its deprecated alias; passing both is SCHEMA_VALIDATION_FAILED). Example: {"node_id": "<node_id>", "namespace_id": "obo-go"}. Since contract revision 4.9.0 limit is the name of top_n (kept as a deprecated alias). The contract revision in force is the one every response repeats in _meta.contract_revision and server_info reports; a revision note (Added in, Since) says when a field or a tool appeared, never which revision is current.

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": {
      "node_id": "<node_id>"
    },
    "name": "get_node_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoHeaviest relations to list per relation type and direction.
top_nNoDeprecated since contract revision 4.9.0: pass limit instead (one name for every answer's size); still accepted.
node_idYesThis room's opaque node id, never an external id.
group_byNoGroup the nodes one relation reaches by a second relation of theirs.
namespace_idNoRoom name; omitted: the default room.
relation_typesNoCount only relations of these types.

Output Schema

NameRequiredDescriptionDefault
nodeYes
groupsYes
scannedYesEdges read for this answer.
warningsNoAdded in contract revision 4.1.0. Set when the node has no edge at all (ISOLATED_NODE with the reason its record gives), so an empty answer reflects missing data rather than the request; empty otherwise.
read_onlyYes
relationsYesBy relation type, then direction.
generationYes
namespace_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), yet the description adds substantial behavior: deterministic with no model call, a 50,000-edge read ceiling, the NEIGHBORHOOD_TOO_LARGE failure with a suggested remedy, and the ISOLATED_NODE warning with a LEMMA_WITHOUT_ROOT reason. This is strong disclosure beyond structured fields; only the absence of any latency/pagination note keeps it from the top.

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

Conciseness3/5

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

Purpose and the sibling alternative are front-loaded, which is right, but the text is dense and repeats itself: node_id's origin is explained twice, and limit/top_n deprecation is stated in the description and again in the schema, plus two trailing sentences about contract revisions that do nothing for an agent choosing or calling this tool. Roughly a quarter of the text is meta-commentary that could be cut without losing invocation guidance.

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?

For a 6-parameter read tool with a nested group_by object and an output schema, the description still covers the return shape (per type/direction counts, weight sums, heaviest partners), the error and warning paths, and the hard read limit. Nothing an agent needs in order to call it correctly or interpret a failure appears to be missing.

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 the baseline is 3, but the description earns more by explaining group_by semantically with a concrete worked case (relation_type OCCURS_IN, direction OUT, via_relation_type HAS_AYAH, via_direction IN → a root's ayahs per surah) and by spelling out direction semantics and the limit/top_n alias conflict that yields SCHEMA_VALIDATION_FAILED. The node_id provenance list (search hit, source, overview, neighbors, paths) also helps validate inputs beyond the schema's terse 'opaque node id'.

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?

Opens with a specific verb and resource ('Summarize one node's relations by type and direction') and immediately delimits scope ('without listing every edge'), contrasting with the sibling query_graph_neighbors. It also names what the summary contains (counts, weights, strongest partners), so an agent can distinguish it from get_node and query_graph_neighbors without opening a schema.

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?

Gives an explicit routing rule: 'use it before query_graph_neighbors on a node with many edges' — naming both the alternative and the condition that selects this tool. The edge-cap and NEIGHBORHOOD_TOO_LARGE guidance ('narrow by relation_types') further tells the agent when to retune rather than switch tools.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources