Skip to main content
Glama

kb_compile_intent

Read-onlyIdempotent

Compile change intent into a deterministic, snapshot-bound, read-only plan before editing code, with contradiction checks, traceability proposals, and dependency-ordered steps for resolved claims.

Instructions

Compile complete change intent into a deterministic, snapshot-bound read-only plan. Use it before editing code for a change request that may touch several requirements; use kb_model for one requirement's prose and kb_plan_bootstrap for first-time onboarding. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. contradictionAnalysis.outcome is no_conflict only when the check could decide: an unmodeled proposition or a related current requirement without logic leaves it unresolved with reasons and reviewCandidates to compare and judge through conflictReviews. 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": {
      "intent": "<intent>",
      "mode": "<mode>"
    },
    "name": "kb_compile_intent"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYesCreate a new requirement or update an existing one.
titleNoOptional requirement title; existing title is preserved for updates when omitted.
intentYesComplete post-change normative intent. Send the desired behavior, not a patch fragment.
clausesNoOptional atomic clause decomposition; each clause must be a verbatim fragment of intent.
contextNoWhy the requirement exists and who asked; required for create. Write 'Reason not stated' rather than invent one.
testDraftsNoOptional test drafts. Tests are attached to scenarios with verified_by; direct req -> test proof links are not emitted.
requirementIdNoOptional exact requirement ID. Required for an update when automatic selection is below the confidence and margin gates.
sourceExcerptNoOptional verbatim text the intent came from, quoted in the Source section; requires context.
workspaceRootNoOptional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's.
scenarioDraftsNoOptional scenario drafts. Each is linked requirement -> scenario with specified_by.
semanticFacetsNoHost-agent facets forwarded to deterministic intent-v1 discovery.
conflictReviewsNoYour verdict on each reviewCandidates entry of a previous compile; a conflict verdict blocks the plan.
interpretationsNoOptional host-supplied typed kibi.logic.v1 interpretations; Kibi validates them before including rule steps.
sourceLocationsNoWorkspace-relative source coordinates used for discovery and before-hash binding.
sourceReferenceNoOptional locator of the source text (ticket id, URL, path) for the Source section; requires context.
proposalDecisionsNoExplicit decisions for deterministic traceability proposals. Pending proposals never enter steps.

Output Schema

NameRequiredDescriptionDefault
dataYes
errorNo
statusYes
effectsYes
operationYes
diagnosticsYes
nextActionsYes
kibiProtocolYes
resultVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed31 schema fields changedv0.1.10
    • changedInput schema / properties / clauses / description
      Previous value: -"Optional complete atomic clause decomposition. Each clause must be a verbatim fragment of intent (whitespace may differ); a clause that does not occur in intent fails the call with VALIDATION_FAILED naming it. Each assertive clause receives independent proposition accounting."New value: +"Optional atomic clause decomposition; each clause must be a verbatim fragment of intent."
    • changedInput schema / properties / conflictReviews / description
      Previous value: -"Your verdict on each contradictionAnalysis.reviewCandidates entry of a previous compile: whether the intent contradicts that current requirement, which Kibi could not compare logically. A conflict verdict blocks the plan; a no_conflict verdict clears that candidate. A verdict may also name a current requirement discovery did not rank."New value: +"Your verdict on each reviewCandidates entry of a previous compile; a conflict verdict blocks the plan."
    • removedInput schema / properties / conflictReviews / items / properties / verdict / anyOf
      Removed value: -[
      -  {
      -    "const": "conflict",
      -    "type": "string"
      -  },
      -  {
      -    "const": "no_conflict",
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / conflictReviews / items / properties / verdict / enum
      Added value: +[
      +  "conflict",
      +  "no_conflict"
      +]
    • addedInput schema / properties / conflictReviews / items / properties / verdict / type
      Added value: +"string"
    • changedInput schema / properties / context / description
      Previous value: -"Why the requirement exists, who asked and anything that does not fit its checked meaning. Required when mode is create (validation error naming this field otherwise); rendered as a '## Context' section of the requirement document, never as part of the checked meaning. Never invent a reason: write 'Reason not stated' when the requester gave none. An update keeps the existing document body unless context is supplied."New value: +"Why the requirement exists and who asked; required for create. Write 'Reason not stated' rather than invent one."
    • removedInput schema / properties / mode / anyOf
      Removed value: -[
      -  {
      -    "const": "create",
      -    "type": "string"
      -  },
      -  {
      -    "const": "update",
      -    "type": "string"
      -  }
      -]
    • changedInput schema / properties / mode / description
      Previous value: -"Create a new requirement or update an existing one. Update auto-selection is allowed only with a high-confidence, well-separated candidate."New value: +"Create a new requirement or update an existing one."
    • addedInput schema / properties / mode / enum
      Added value: +[
      +  "create",
      +  "update"
      +]
    • addedInput schema / properties / mode / type
      Added value: +"string"
    • removedInput schema / properties / proposalDecisions / items / properties / decision / anyOf
      Removed value: -[
      -  {
      -    "const": "accept",
      -    "type": "string"
      -  },
      -  {
      -    "const": "reject",
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / proposalDecisions / items / properties / decision / enum
      Added value: +[
      +  "accept",
      +  "reject"
      +]
    • addedInput schema / properties / proposalDecisions / items / properties / decision / type
      Added value: +"string"
    • changedInput schema / properties / sourceExcerpt / description
      Previous value: -"Optional verbatim text the intent came from (a ticket, a message, a document passage). Rendered as a blockquote in the requirement's '## Source' section; requires context."New value: +"Optional verbatim text the intent came from, quoted in the Source section; requires context."
    • changedInput schema / properties / sourceReference / description
      Previous value: -"Optional locator of the source text (ticket id, URL, path). Rendered in the requirement's '## Source' section; requires context."New value: +"Optional locator of the source text (ticket id, URL, path) for the Source section; requires context."
    • removedInput schema / properties / testDrafts / items / properties / verificationPerspective / anyOf
      Removed value: -[
      -  {
      -    "const": "internal",
      -    "type": "string"
      -  },
      -  {
      -    "const": "consumer",
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / testDrafts / items / properties / verificationPerspective / enum
      Added value: +[
      +  "internal",
      +  "consumer"
      +]
    • addedInput schema / properties / testDrafts / items / properties / verificationPerspective / type
      Added value: +"string"
    • removedInput schema / properties / testDrafts / items / properties / verificationScope / anyOf
      Removed value: -[
      -  {
      -    "const": "unit",
      -    "type": "string"
      -  },
      -  {
      -    "const": "integration",
      -    "type": "string"
      -  },
      -  {
      -    "const": "end_to_end",
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / testDrafts / items / properties / verificationScope / enum
      Added value: +[
      +  "unit",
      +  "integration",
      +  "end_to_end"
      +]
    • addedInput schema / properties / testDrafts / items / properties / verificationScope / 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. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/non-destructive, so 'No mutation side effects' adds nothing new. The description does add real behavior beyond annotations: it accounts for every proposition, emits dependency-ordered kb_upsert-style steps only for resolved typed claims, and specifies that contradictionAnalysis.outcome is no_conflict only when the check could decide, otherwise leaving it unresolved with reasons and reviewCandidates.

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-loaded with the core action, then routing guidance, then behavioral detail; every sentence carries information. The final two sentences are dense with nested terms (contradictionAnalysis.outcome, reviewCandidates, conflictReviews) that take effort to parse, but nothing is filler.

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 16-parameter tool with an output schema and full annotation coverage, the description covers purpose, alternatives, mutation safety, and the unresolved-conflict workflow an agent must act on. Parameter-level guidance is delegated to a fully documented schema, which is acceptable here, though the many optional draft/decision inputs are not addressed at all.

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% across all 16 parameters, so the schema already carries parameter meaning, including conflictReviews blocking behavior. The description reinforces the conflictReviews/reviewCandidates loop but adds no syntax or constraint detail beyond the schema; baseline 3 is appropriate.

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 artifact: compile change intent into a deterministic, snapshot-bound read-only plan, and names two siblings (kb_model, kb_plan_bootstrap) with the conditions that distinguish them. An agent can identify the tool's role 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit when-to-use ('before editing code for a change request that may touch several requirements') plus explicit alternatives: kb_model for one requirement's prose, kb_plan_bootstrap for first-time onboarding. It also explains the conflictReviews feedback path when a prior compile returns unresolved.

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