Skip to main content
Glama

kb_graph

Read-onlyIdempotent

Traverse relationships from given seed IDs to return reached nodes and edges, with depth and size limits; use it to follow links from known requirements, scenarios, tests, or symbols.

Instructions

Run bounded graph traversal from one or more seed IDs across curated relationship types and return the nodes and edges reached. Use it to follow links from IDs you already have, such as a requirement to its scenarios and tests or a symbol to the requirements it implements; use kb_query to find entities by filter and kb_search to ask a question. Traversal stops at depth, maxNodes or maxEdges and then sets truncated. No mutation side effects.

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": {
      "seedIds": "<seedIds>"
    },
    "name": "kb_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
kbNoOptional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB.
depthNoNumber of hops from the seeds.
seedIdsYesEntity IDs to start from, for example REQ-... or SCEN-.... Seeds are always returned as nodes.
maxEdgesNoStop and set truncated once this many edges are reached.
maxNodesNoStop and set truncated once this many nodes are reached.
directionNooutgoing follows links from each node, incoming follows links pointing at it, both does either.
entityTypesNoKeep only nodes of these types and the edges between them; traversal still passes through other types.
relationshipsNoRelationship types to follow, e.g. specified_by, verified_by or implements. Omit to follow every type.
workspaceRootNoOptional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's.

Output Schema

NameRequiredDescriptionDefault
dataYes
errorNo
statusYes
effectsYes
operationYes
diagnosticsYes
nextActionsYes
kibiProtocolYes
resultVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changedv0.1.10
    • removedInput schema / properties / direction / anyOf
      Removed value: -[
      -  {
      -    "const": "outgoing",
      -    "type": "string"
      -  },
      -  {
      -    "const": "incoming",
      -    "type": "string"
      -  },
      -  {
      -    "const": "both",
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / direction / enum
      Added value: +[
      +  "outgoing",
      +  "incoming",
      +  "both"
      +]
    • addedInput schema / properties / direction / type
      Added value: +"string"
    • changedInput schema / properties / entityTypes / description
      Previous value: -"Keep only nodes of these types (req, scenario, test, adr, flag, event, symbol, fact) in the result, and the edges between them. Traversal still passes through other types."New value: +"Keep only nodes of these types and the edges between them; traversal still passes through other types."
    • changedInput schema / properties / kb / description
      Previous value: -"Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB."New value: +"Optional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB."
    • changedInput schema / properties / relationships / description
      Previous value: -"Relationship types to follow, for example specified_by, verified_by or implements. Omit to follow every relationship type."New value: +"Relationship types to follow, e.g. specified_by, verified_by or implements. Omit to follow every type."
    • changedInput schema / properties / workspaceRoot / description
      Previous value: -"Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available."New value: +"Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's."
    • removedOutput schema / properties / diagnostics / items / properties / severity / anyOf
      Removed value: -[
      -  {
      -    "const": "info",
      -    "type": "string"
      -  },
      -  {
      -    "const": "warning",
      -    "type": "string"
      -  },
      -  {
      -    "const": "error",
      -    "type": "string"
      -  }
      -]
    • addedOutput schema / properties / diagnostics / items / properties / severity / enum
      Added value: +[
      +  "info",
      +  "warning",
      +  "error"
      +]
    • addedOutput schema / properties / diagnostics / items / properties / severity / type
      Added value: +"string"
    • removedOutput schema / properties / effects / items / properties / status / anyOf
      Removed value: -[
      -  {
      -    "const": "completed",
      -    "type": "string"
      -  },
      -  {
      -    "const": "failed",
      -    "type": "string"
      -  },
      -  {
      -    "const": "not_applicable",
      -    "type": "string"
      -  }
      -]
    • addedOutput schema / properties / effects / items / properties / status / enum
      Added value: +[
      +  "completed",
      +  "failed",
      +  "not_applicable"
      +]
    • addedOutput schema / properties / effects / items / properties / status / type
      Added value: +"string"
    • removedOutput schema / properties / status / anyOf
      Removed value: -[
      -  {
      -    "const": "success",
      -    "type": "string"
      -  },
      -  {
      -    "const": "committed_with_repairs",
      -    "type": "string"
      -  },
      -  {
      -    "const": "error",
      -    "type": "string"
      -  }
      -]
    • addedOutput schema / properties / status / enum
      Added value: +[
      +  "success",
      +  "committed_with_repairs",
      +  "error"
      +]
    • addedOutput schema / properties / status / type
      Added value: +"string"
  2. Changed1 schema field changedv0.1.8
    • addedInput schema / properties / kb
      Added value: +{
      +  "description": "Optional KB dependency to read instead of this project's own KB: a name declared in .kb/dependencies.json and pinned in .kb/dependencies.lock.json. The answer comes from that repository's own read-only KB at the pinned commit, kept apart from this project's KB. Omit it to read this project's KB.",
      +  "maxLength": 64,
      +  "minLength": 1,
      +  "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
      +  "type": "string"
      +}
  3. Changed7 schema fields changedv0.1.3
    • addedInput schema / properties / depth / description
      Added value: +"Number of hops from the seeds."
    • addedInput schema / properties / direction / description
      Added value: +"outgoing follows links from each node, incoming follows links pointing at it, both does either."
    • addedInput schema / properties / entityTypes / description
      Added value: +"Keep only nodes of these types (req, scenario, test, adr, flag, event, symbol, fact) in the result, and the edges between them. Traversal still passes through other types."
    • addedInput schema / properties / maxEdges / description
      Added value: +"Stop and set truncated once this many edges are reached."
    • addedInput schema / properties / maxNodes / description
      Added value: +"Stop and set truncated once this many nodes are reached."
    • addedInput schema / properties / relationships / description
      Added value: +"Relationship types to follow, for example specified_by, verified_by or implements. Omit to follow every relationship type."
    • addedInput schema / properties / seedIds / description
      Added value: +"Entity IDs to start from, for example REQ-... or SCEN-.... Seeds are always returned as nodes."
  4. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered and 'No mutation side effects' largely restates it. The description does add genuinely new behavior: traversal halts at depth, maxNodes or maxEdges and sets a truncated flag, which tells the agent how to detect incomplete results. It does not discuss invalid or unknown seed IDs, which would have completed the picture.

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?

Three sentences, front-loaded with the operation and then routing, with no filler. The middle sentence is long and carries two examples plus two sibling redirects, which is dense but each clause does work.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema, full annotation coverage and 100% parameter documentation, the description only needs to supply purpose, routing and bound semantics, all of which it does. The remaining gap is error/edge-case behavior for unresolvable seeds, which is minor for a read-only traversal tool.

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 adds meaning by binding the three bound parameters together and tying them to the truncated outcome, which the schema only states per-parameter. The seed example framing ('follow links from IDs you already have') also clarifies what seedIds should contain in practice beyond the schema's 'REQ-... or SCEN-...' hint.

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 definition opens with a precise verb+resource statement: 'Run bounded graph traversal from one or more seed IDs across curated relationship types and return the nodes and edges reached.' It distinguishes itself from siblings by explicitly naming kb_query (filter lookup) and kb_search (question answering), so an agent can route without opening other schemas.

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 states the exact condition for use — 'follow links from IDs you already have' — and gives concrete example chains (requirement to scenarios/tests, symbol to requirements it implements). It also delegates the two competing cases to kb_query and kb_search, which is explicit when-not guidance.

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