Skip to main content
Glama

kb_record

Destructive

Records a stated rule with rationale, author, quote, implementing code and optional test, submits it as a knowledge-base upsert, and returns the commit gate verdict, findings and next actions.

Instructions

Record a rule as it is stated: statement, why, saidBy, quote, code and an optional test. Kibi writes it as one kb_upsert payload and returns the commit gate's verdict (commitAllowed, findings with blocks) and the steps left as nextActions. dryRun:true returns the payload and writes nothing. Facts, links, updates and other modeling: kb_upsert.

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": {
      "statement": "<statement>",
      "why": "<why>",
      "saidBy": "<saidBy>",
      "code": "<code>"
    },
    "name": "kb_record"
  }
}

Input Schema

NameRequiredDescriptionDefault
whyYesWhy it exists, in their words; 'Reason not stated' if none given.
codeYesDeclarations that implement it, each {file, symbol}.
testNoAn existing TEST id that checks it.
quoteNoTheir words, recorded as origin.ref; a firm rule needs one.
dryRunNoReturn the kb_upsert payload; write nothing.
saidByYesuser or maintainer (firm), or agent (default).
statementYesThe rule as one testable must sentence.
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. Addedv0.1.10

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare this a destructive, non-idempotent, non-read-only write. The description goes further by describing the pipeline (folded into one kb_upsert payload) and the commit-gate verdict returned (commitAllowed, findings with blocks, nextActions) plus the dryRun no-write path, which is meaningful context. It does not, however, disclose failure modes, what blocks a commit, or irreversibility beyond what the hints imply.

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?

Front-loads what is recorded, then the write/return mechanics, then dryRun, then the alternative — a sensible ordering with no filler. The second sentence is dense and slightly run-on, packing payload construction and return shape together.

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 destructive write tool with an output schema and full parameter coverage, the description covers the essentials: what it writes, where it goes, what comes back, and how to preview safely. Only error/blocking semantics and the 'firm rule needs a quote' constraint are left entirely to the schema.

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%, so all eight parameters are already documented in structured form, and the description mostly restates those names in prose. The only added nuance is emphasis on 'as it is stated', which the schema's own 'in their words' wording already conveys.

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 ('Record a rule') and enumerates exactly what constitutes the record: statement, why, saidBy, quote, code, optional test. The closing clause routes non-rule modeling to kb_upsert, so the agent can separate this tool from its closest sibling without opening either 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?

Explicitly assigns facts, links, updates and 'other modeling' to kb_upsert, which is clear alternative routing. It does not state an explicit exclusion or precondition for this tool (e.g. 'only when a rule was actually stated by a user or maintainer'), so it stops short of full when/when-not guidance.

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