Skip to main content
Glama

Knowledge graph traversal

get_knowledge_graph
Read-onlyIdempotent

Traverse the app's knowledge graph from a seed component or page to see how it connects to the rest of the system. Returns nodes and edges within a configurable depth (default 2, max 4) for architecture and dependency analysis.

Instructions

Traverse the knowledge graph from a seed component or page. Returns { nodes: [{ id, label, node_type }], edges: [{ source_node_id, target_node_id, edge_type }] } within a depth budget (default 2, max 4 hops). Read-only. Use to see how a component connects to the rest of the app; use get_blast_radius for a bug's impact area, or get_graph_neighborhood for a tighter BFS around one node.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedYesStarting graph node id or human-readable label to traverse from
depthNoBFS hops outward from seed — clamped to 4 in the handler (default 2)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
edgesYesEdges connecting the returned nodes
nodesYesGraph nodes within the depth budget

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.10
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed3 schema fields changedv0.1.2
    • changedInput schema / properties / depth / description
      Previous value: -"Traversal depth (default 2, max 4)"New value: +"BFS hops outward from seed — clamped to 4 in the handler (default 2)"
    • changedInput schema / properties / seed / description
      Previous value: -"Starting node id or label"New value: +"Starting graph node id or human-readable label to traverse from"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "edges": {
      +      "description": "Edges connecting the returned nodes",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "nodes": {
      +      "description": "Graph nodes within the depth budget",
      +      "items": {},
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "nodes",
      +    "edges"
      +  ],
      +  "type": "object"
      +}
  3. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already provide readOnlyHint, idempotentHint, and openWorldHint, and the description reinforces the read-only nature while adding behavioral context beyond annotations: the traversal respects a depth budget (default 2, max4 hops) and returns a specific nodes/edges structure. It does not contradict any annotation.

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?

The description is short,front-loaded with purpose and output, and contains no fluff. The only slight redundancy is stating 'Read-only' when the annotations already declare readOnlyHint, and the return shape is already expressed by the output schema, but overall the structure is effective.

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 read-only traversal tool with only one required parameter and a rich output schema, the description covers the key behavioral constraints (depth default/max), the intended usage, and the sibling differentiation. Nothing essential for an agent to correctly select and invoke this tool is missing.

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

Parameters3/5

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

Schema description coverage is 100%, with seed and depth already documented. The description loosely reinforces these concepts by calling the seed a 'component or page' and mentioning the depth budget, but it does not add meaningful semantic details beyond the 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 states a specific action and resource: 'Traverse the knowledge graph from a seed component or page.' It also names the return shape (nodes and edges) and explicitly differentiates from sibling tools by pointing to get_blast_radius and get_graph_neighborhood, making the purpose unambiguous.

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 explicitly says when to use this tool: 'Use to see how a component connects to the rest of the app.' It also names alternatives and their specific use cases: get_blast_radius for a bug's impact area and get_graph_neighborhood for a tighter BFS around one node.

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