Skip to main content
Glama
littlebigbrains

@littlebigbrain/mcp

lbb_commit

DestructiveIdempotent

Writes or retracts knowledge-graph facts and stores ranked search feedback, with approval for destructive edits and idempotent retries.

Instructions

Write graph facts, retract them, or label ranked results. Explicit mode=records forwards a strict records/1 body, with exact IRIs/terms and the original receipt. It requires an existing support-enabled graph; protocol recognition never activates or converts a graph. Record edits that may remove support (set/unset/remove/delete/replace_scope or asserted=false) ask for approval. mode=facts writes triplets/embeddings/properties; mode=retract removes a wrongly-added fact (by edge or by entity) without a full reset; mode=search_feedback stores query/result relevance labels (Feedback grades: 3=ideal/good, 1=partial, 0=bad; include query, search_id when available, target, rank, score). Explicit idempotency_key wins; when omitted, MCP derives a stable content hash so content-identical retries dedupe. Facts mode defaults edge_idempotency to append; pass skip_unchanged for re-runnable backfills. A retract asks the person to approve the links and records it removes first. The server asks the person to approve it through the client (MCP form elicitation) and sends nothing when they decline (approval_declined). A client that cannot show the question gets approval_required and nothing is sent, unless the MCP server's environment sets LBB_MCP_DESTRUCTIVE=allow.

Input Schema

NameRequiredDescriptionDefault
modeNo
graphNoGraph to target; defaults to the connection's graph
dry_runNoValidate a facts commit and return its structured SHACL report without writing. Only supported for mode=facts.
recordsNoExplicit mode=records only: the unchanged RecordCommitRequest object with version=records/1. Unknown fields are preserved for strict server validation; no native IRI normalization or scalar coercion. Cannot mix legacy write arguments.
tripletsNo
observed_atNoBackfill timestamp (RFC3339). Records this commit AS OF that instant: stamps transaction time and defaults each triplet's valid_time.start. Replay history in order with observed_at per commit so as-of reads by date work. Omit for live writes.
retract_edgesNomode=retract: specific edges to remove, matched by (source, relation, target).
idempotency_keyNo
search_feedbackNo
edge_idempotencyNoDefaults to append in MCP. Use skip_unchanged for backfills; it skips exact current-edge duplicates and drops evidence-only repeats.
retract_entitiesNomode=retract: entities whose every current edge is removed (a current-state tombstone; the record and its history are kept for as_of reads).
entity_embeddingsNo
entity_propertiesNoTyped scalar attributes per entity. Each item is { type, name, properties }. `properties` is a flat map of field -> value, e.g. { "type": "PERSON", "name": "Ada Lovelace", "properties": { "h_index": 52, "title": "VP", "last_contact": "2026-06-26" } }. Values are coerced to each field's declared type, so a string like "2026-06-26" lands in a date_time field and "52" in an i64 field. (The verbose form [{ field, value: { i64: 52 } }] is also accepted.) Register a field first with lbb_configure evolve_ontology add_property; the commit response echoes written_properties so you can confirm what landed.
expected_graph_epochNomode=records only: exact decimal graph incarnation guard. Protocol support does not activate this graph.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.17.0
    • addedInput schema / properties / expected_graph_epoch
      Added value: +{
      +  "description": "mode=records only: exact decimal graph incarnation guard. Protocol support does not activate this graph.",
      +  "type": "string"
      +}
    • changedInput schema / properties / mode / enum
      Previous value: -[
      -  "facts",
      -  "retract",
      -  "search_feedback"
      -]New value: +[
      +  "facts",
      +  "retract",
      +  "search_feedback",
      +  "records"
      +]
    • addedInput schema / properties / records
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Explicit mode=records only: the unchanged RecordCommitRequest object with version=records/1. Unknown fields are preserved for strict server validation; no native IRI normalization or scalar coercion. Cannot mix legacy write arguments.",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  2. Changed21 schema fields changedv0.16.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / entity_embeddings / items / properties
      Added value: +{
      +  "entity_id": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "key": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "metric": {
      +    "anyOf": [
      +      {
      +        "enum": [
      +          "cosine",
      +          "dot",
      +          "l2"
      +        ],
      +        "type": "string"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ]
      +  },
      +  "model_id": {
      +    "type": "string"
      +  },
      +  "name": {
      +    "type": "string"
      +  },
      +  "type": {
      +    "type": "string"
      +  },
      +  "vector": {
      +    "items": {
      +      "type": "number"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedInput schema / properties / entity_embeddings / items / required
      Added value: +[
      +  "type",
      +  "name",
      +  "model_id",
      +  "vector"
      +]
    • addedInput schema / properties / entity_properties / items / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / retract_edges / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / retract_edges / items / properties / source / additionalProperties
      Removed value: -false
    • removedInput schema / properties / retract_edges / items / properties / target / additionalProperties
      Removed value: -false
    • removedInput schema / properties / retract_entities / items / additionalProperties
      Removed value: -false
    • changedInput schema / properties / search_feedback / additionalProperties
      Previous value: -trueNew value: +{}
    • changedInput schema / properties / search_feedback / properties / labels / items / additionalProperties
      Previous value: -trueNew value: +{}
    • addedInput schema / properties / search_feedback / properties / labels / items / properties / rank / maximum
      Added value: +9007199254740991
    • removedInput schema / properties / search_feedback / properties / labels / items / properties / target / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "entity": {
      -        "additionalProperties": true,
      -        "properties": {
      -          "entity_id": {
      -            "description": "Entity id (hex), as an alternative to type+name",
      -            "type": "string"
      -          },
      -          "entity_type": {
      -            "description": "Entity type name (with `name`, names a fixed entity)",
      -            "type": "string"
      -          },
      -          "name": {
      -            "description": "Entity name (paired with `entity_type`)",
      -            "type": "string"
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "kind": {
      -        "const": "entity",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "entity"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "edge_event_id": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "assertion",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "edge_event_id"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "kind": {
      -        "const": "observation",
      -        "type": "string"
      -      },
      -      "observation_id": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "observation_id"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "concept_id": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "concept",
      -        "type": "string"
      -      },
      -      "name": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / search_feedback / properties / labels / items / properties / target / oneOf
      Added value: +[
      +  {
      +    "additionalProperties": {},
      +    "properties": {
      +      "entity": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "entity_id": {
      +            "description": "Entity id (hex), as an alternative to type+name",
      +            "type": "string"
      +          },
      +          "entity_type": {
      +            "description": "Entity type name (with `name`, names a fixed entity)",
      +            "type": "string"
      +          },
      +          "name": {
      +            "description": "Entity name (paired with `entity_type`)",
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "kind": {
      +        "const": "entity",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "entity"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": {},
      +    "properties": {
      +      "edge_event_id": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "assertion",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "edge_event_id"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": {},
      +    "properties": {
      +      "kind": {
      +        "const": "observation",
      +        "type": "string"
      +      },
      +      "observation_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "observation_id"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": {},
      +    "properties": {
      +      "concept_id": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "concept",
      +        "type": "string"
      +      },
      +      "name": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / search_feedback / properties / profile / anyOf
      Added value: +[
      +  {
      +    "enum": [
      +      "baseline",
      +      "scored_atom_v1",
      +      "graph_aware_v1",
      +      "ndcg_v1"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / search_feedback / properties / profile / type
      Removed value: -"string"
    • addedInput schema / properties / search_feedback / properties / snapshot / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / triplets / items / additionalProperties
      Removed value: -false
    • addedInput schema / properties / triplets / items / properties / evidence / anyOf
      Added value: +[
      +  {
      +    "anyOf": [
      +      {
      +        "type": "string"
      +      },
      +      {
      +        "additionalProperties": {},
      +        "properties": {
      +          "observation_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "region": {
      +            "anyOf": [
      +              {
      +                "additionalProperties": {},
      +                "properties": {
      +                  "confidence": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "page": {
      +                    "maximum": 9007199254740991,
      +                    "minimum": 0,
      +                    "type": "integer"
      +                  },
      +                  "x0": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "x1": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "y0": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  },
      +                  "y1": {
      +                    "maximum": 1,
      +                    "minimum": 0,
      +                    "type": "number"
      +                  }
      +                },
      +                "required": [
      +                  "page",
      +                  "x0",
      +                  "y0",
      +                  "x1",
      +                  "y1",
      +                  "confidence"
      +                ],
      +                "type": "object"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "source_id": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "text": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / triplets / items / properties / source / additionalProperties
      Removed value: -false
    • removedInput schema / properties / triplets / items / properties / target / additionalProperties
      Removed value: -false
    • removedInput schema / properties / triplets / items / properties / valid_time / additionalProperties
      Removed value: -false
  3. Changed1 schema field changedv0.5.2
    • removedInput schema / properties / branch
      Removed value: -{
      -  "description": "Branch to target; defaults to the connection's branch",
      -  "type": "string"
      -}
  4. Changed1 schema field changedv0.5.1
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "Validate a facts commit and return its structured SHACL report without writing. Only supported for mode=facts.",
      +  "type": "boolean"
      +}
  5. First observedv0.2.1

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the full approval flow: support-removing edits ask the person via MCP form elicitation, decline yields approval_declined, a non-interactive client yields approval_required, and LBB_MCP_DESTRUCTIVE=allow bypasses it. It also explains idempotency-key content-hash derivation and edge_idempotency defaults, and that retract is a current-state tombstone preserving history. This is exactly the context annotations alone cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and mode enumeration are front-loaded, but the body is one dense paragraph across four modes and 14 parameters. The approval mechanism is restated twice ('A retract asks the person to approve ... first' followed by the fuller server/elicitation explanation), adding length without new information.

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 complex, nested, multi-mode mutation tool with no output schema, the description covers prerequisites, approval outcomes, idempotency, and partial return signals (original receipt, written_properties echo, SHACL report for dry_run). It leaves the facts-mode success payload and other error codes unstated.

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?

At 64% schema coverage, the description adds real meaning beyond the schema: mode selection semantics, records-body strictness ('unknown fields are preserved ... no native IRI normalization'), retract by edge vs. by entity, the 3/1/0 feedback grading scale, and idempotency_key/edge_idempotency behavior. It omits observed_at and dry_run entirely, relying on their schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names specific verbs and resources ('Write graph facts, retract them, or label ranked results') and then enumerates the four modes, so an agent immediately knows this is the mutation entry point. It never names a sibling tool (e.g., lbb_query for reads), so sibling differentiation is left implicit rather than stated.

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?

Each mode is given a use case: facts for triplets/embeddings/properties, retract for 'a wrongly-added fact ... without a full reset', search_feedback for storing relevance labels, and records for the strict body path. It also states the prerequisite ('requires an existing support-enabled graph') and backfill guidance (skip_unchanged). It stops short of routing to alternative tools for reads or embedding management.

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