Skip to main content
Glama

kb_search

Read-onlyIdempotent

Ask questions or search the project knowledge base to find governing requirements, evidence, linked facts, ADRs, and verifying scenarios or tests before changing behavior.

Instructions

Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic with their statement and recorded reason (why), what must stay true (linked facts), the deciding ADRs and what verifies it (scenarios, tests). A weak answer may add queryAnalysis.hints from a search-hints plugin: requirements the question may mean, to re-ask with. Use before changing behavior, then kb_query for exact follow-up. 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": {
      "query": "<query>"
    },
    "name": "kb_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
kbNoOptional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB.
typeNoOptional entity type filter to narrow discovery. Example: 'req'.
hintsNoIntent-v1, first page: when true (default), a weak answer adds hints from a kibi.search-hints.v1 plugin.
limitNoOptional max rows after ranking. Default: 10; raise it or page with offset when the answer layer is not enough.
queryYesFree-text query for metadata and markdown body discovery. Example: 'OAuth login flow'.
answerNoIntent-v1, first page: when true (default), include the answer layer of governing requirements and their evidence.
fieldsNoOptional result detail: 'summary' (metadata, snippet) or 'full' (also bodies, graph paths, fact kb_query calls).
offsetNoOptional zero-based pagination offset. Default: 0.
minScoreNoIntent-v1 acceptance threshold between 0 and 1. Low-confidence queries abstain instead of returning misleading matches.
rankingModeNoOptional ranking mode: intent-v1 (default, question-aware) or legacy (older lexical ranking).
workspaceRootNoOptional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's.
semanticFacetsNoOptional host-agent interpretations Kibi uses as deterministic aliases and facets; ranking never calls a model.
sourceLocationsNoOptional changed-code locations. Results are matched to source-linked symbols/entities and include source evidence.

Output Schema

NameRequiredDescriptionDefault
dataYes
errorNo
statusYes
effectsYes
operationYes
diagnosticsYes
nextActionsYes
kibiProtocolYes
resultVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed26 schema fields changedv0.1.10
    • changedInput schema / properties / answer / description
      Previous value: -"Intent-v1 only, first page only. When true (default) the result includes an answer layer: current governing requirements with their linked facts, scenarios, tests and ADRs, superseded requirements listed separately, and observation facts labelled as notes. Bounded in size; discovery, not proof."New value: +"Intent-v1, first page: when true (default), include the answer layer of governing requirements and their evidence."
    • removedInput schema / properties / fields / anyOf
      Removed value: -[
      -  {
      -    "const": "summary",
      -    "type": "string"
      -  },
      -  {
      -    "const": "full",
      -    "type": "string"
      -  }
      -]
    • changedInput schema / properties / fields / description
      Previous value: -"Optional result detail. 'summary' returns identifying metadata plus the match snippet for discovery. Use 'full' to include complete entity bodies, or follow up with kb_query for the exact entities you need."New value: +"Optional result detail: 'summary' (metadata, snippet) or 'full' (also bodies, graph paths, fact kb_query calls)."
    • addedInput schema / properties / fields / enum
      Added value: +[
      +  "summary",
      +  "full"
      +]
    • addedInput schema / properties / fields / type
      Added value: +"string"
    • changedInput schema / properties / hints / description
      Previous value: -"Intent-v1 only, first page only. When true (default) and the project activates a kibi.search-hints.v1 plugin, a weak or abstained answer adds queryAnalysis.hints: requirements the question may mean, to re-ask with. Hints never change results or the answer layer."New value: +"Intent-v1, first page: when true (default), a weak answer adds hints from a kibi.search-hints.v1 plugin."
    • 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 / limit / description
      Previous value: -"Optional max rows to return after ranking. Default: 10; raise it or page with offset when the answer layer is not enough."New value: +"Optional max rows after ranking. Default: 10; raise it or page with offset when the answer layer is not enough."
    • removedInput schema / properties / rankingMode / anyOf
      Removed value: -[
      -  {
      -    "const": "legacy",
      -    "type": "string"
      -  },
      -  {
      -    "const": "intent-v1",
      -    "type": "string"
      -  }
      -]
    • changedInput schema / properties / rankingMode / description
      Previous value: -"Optional deterministic ranking mode. Default intent-v1: question-aware ranking with semantic facets, source-aware evidence, graph boosts, superseded demotion and abstention. Use legacy for the older lexical ranking."New value: +"Optional ranking mode: intent-v1 (default, question-aware) or legacy (older lexical ranking)."
    • addedInput schema / properties / rankingMode / enum
      Added value: +[
      +  "legacy",
      +  "intent-v1"
      +]
    • addedInput schema / properties / rankingMode / type
      Added value: +"string"
    • changedInput schema / properties / semanticFacets / description
      Previous value: -"Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; ranking never calls a model."New value: +"Optional host-agent interpretations Kibi uses as deterministic aliases and facets; ranking never calls a model."
    • 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. Changed2 schema fields changedv0.1.6
    • addedInput schema / properties / hints
      Added value: +{
      +  "description": "Intent-v1 only, first page only. When true (default) and the project activates a kibi.search-hints.v1 plugin, a weak or abstained answer adds queryAnalysis.hints: requirements the question may mean, to re-ask with. Hints never change results or the answer layer.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / semanticFacets / description
      Previous value: -"Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; it does not call a model itself."New value: +"Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; ranking never calls a model."
  4. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, but the description adds substantial context: intent-v1 default ranking, evidence return, confidence-threshold abstention, answer-layer contents, and weak-answer hint generation. These behavioral traits are not encoded in the annotations.

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 front-loaded and avoids filler, but the core sentence is a long run-on with multiple parenthetical layers that makes it harder to scan. It is appropriately sized for the tool's complexity, yet the structure could be tighter.

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 13-parameter tool with nested objects and an output schema, the description covers the critical behavioral and usage context: ranking mode, abstention, answer layer, hints, and safety. Parameter-level details are left to the 100%-covered schema, which is appropriate.

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 schema already documents all 13 parameters. The description nonetheless adds conceptual meaning for several: it explains what semantic facets and changed-code source locations feed into ranking, what the answer layer contains, and how weak-answer hints are generated. The gain is real but mostly explanatory rather than parameter-specific.

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 opening sentence names the KB resource and the two supported modes (question or search), and the later clause routes exact follow-up to kb_query. This lets an agent distinguish it from sibling retrieval 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?

It gives a clear primary use case ('Use before changing behavior') and names kb_query as the alternative for exact follow-up. It does not state when this tool should not be used or cover other sibling alternatives, so the guidance stops short of exhaustive.

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