Skip to main content
Glama

kb_find_gaps

Read-onlyIdempotent

Find knowledge-base entities missing or containing specified relationships, such as requirements without scenarios or tests. Filter by type, tags, source file, and present or missing relationships.

Instructions

List KB entities by the relationships they lack or have. Use for questions like which requirements lack scenarios or tests; all filters must match, and a relationship counts in either direction. Use kb_coverage instead for proof status and repair plans, and kb_check for rule violations. No mutation side effects.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "kb_find_gaps"
  }
}

Input Schema

NameRequiredDescriptionDefault
kbNoOptional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB.
tagsNoKeep entities carrying any of these metadata tags.
typeNoOnly report entities of this type. Omit for all types.
limitNoMaximum rows to return; count reports the full total.
offsetNoZero-based row offset for pagination.
sourceFileNoKeep entities whose source path contains this substring.
workspaceRootNoOptional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's.
missingRelationshipsNoRelationship types the entity must have none of, e.g. specified_by or verified_by.
presentRelationshipsNoRelationship types the entity must have at least one of each, in either direction.

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
    • 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 / missingRelationships / description
      Previous value: -"Relationship types the entity must have none of, in either direction, for example specified_by or verified_by. verified_by and validates satisfy each other."New value: +"Relationship types the entity must have none of, e.g. specified_by or verified_by."
    • changedInput schema / properties / tags / description
      Previous value: -"Keep entities carrying any of these metadata tags. Bootstrap provenance stubs appear in rows only when this names bootstrap:provenance-stub."New value: +"Keep entities carrying any of these metadata tags."
    • removedInput schema / properties / type / anyOf
      Removed value: -[
      -  {
      -    "const": "req",
      -    "type": "string"
      -  },
      -  {
      -    "const": "scenario",
      -    "type": "string"
      -  },
      -  {
      -    "const": "test",
      -    "type": "string"
      -  },
      -  {
      -    "const": "adr",
      -    "type": "string"
      -  },
      -  {
      -    "const": "flag",
      -    "type": "string"
      -  },
      -  {
      -    "const": "event",
      -    "type": "string"
      -  },
      -  {
      -    "const": "symbol",
      -    "type": "string"
      -  },
      -  {
      -    "const": "fact",
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / type / enum
      Added value: +[
      +  "req",
      +  "scenario",
      +  "test",
      +  "adr",
      +  "flag",
      +  "event",
      +  "symbol",
      +  "fact"
      +]
    • addedInput schema / properties / type / type
      Added value: +"string"
    • 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 / limit / description
      Added value: +"Maximum rows to return; count reports the full total."
    • addedInput schema / properties / missingRelationships / description
      Added value: +"Relationship types the entity must have none of, in either direction, for example specified_by or verified_by. verified_by and validates satisfy each other."
    • addedInput schema / properties / offset / description
      Added value: +"Zero-based row offset for pagination."
    • addedInput schema / properties / presentRelationships / description
      Added value: +"Relationship types the entity must have at least one of each, in either direction."
    • addedInput schema / properties / sourceFile / description
      Added value: +"Keep entities whose source path contains this substring."
    • addedInput schema / properties / tags / description
      Added value: +"Keep entities carrying any of these metadata tags. Bootstrap provenance stubs appear in rows only when this names bootstrap:provenance-stub."
    • addedInput schema / properties / type / description
      Added value: +"Only report entities of this type. Omit for all types."
  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?

Adds real semantics beyond the annotations: filters combine as AND ('all filters must match') and relationships count in either direction, which is not stated for missingRelationships in the schema. The trailing 'No mutation side effects' largely restates readOnlyHint/destructiveHint=false, so it earns slightly less than full marks.

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 tight sentences, front-loaded with purpose before the use case and the alternative routing. The final safety sentence duplicates the readOnly/destructive annotations and is the one non-earning line.

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?

For a 9-parameter read tool with an output schema and full annotation coverage, the description covers purpose, filtering semantics, and sibling routing, so an agent could call it correctly. Only the interaction between limit/offset and the count total is left implicit, which the schema partially handles.

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 the schema does not: the AND-combination of all filters and the either-direction rule applying to both relationship filters. Pagination and the kb/workspaceRoot scoping are left entirely to 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?

States a specific verb and resource ('List KB entities') plus the distinguishing axis: filtering by relationships present or absent. The agent can immediately tell this is a relationship-gap query, not a general entity search.

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 a concrete use case ('which requirements lack scenarios or tests') and explicitly routes two alternatives elsewhere: kb_coverage for proof status and repair plans, kb_check for rule violations. When-to-use, when-not-to-use, and the alternatives are all present.

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