Skip to main content
Glama

Knowledge Corpus

manage_corpus
Destructive

Register, route, grant, deny, and inspect access to cold-reference corpus documents; record reads and acquisitions while auditing mutations for controlled knowledge use.

Instructions

Manage the cold-reference knowledge corpus. corpus_register indexes a document with optional access_public, access_domains, grants, and denies; route derives its domain from a trusted source profile; grant and deny add per-entity decisions, and an explicit deny overrides public, grant, and domain access; access sets an entity's domain profile; consume records a read. Mutating actions persist access state and are audited; list, get, and acquisitions are read-only. Corpus mutations are not undoable via manage_history. Use when: registering, listing, reading, routing, granting/denying access, consuming, or inspecting acquisitions of corpus documents. Do NOT use when: writing Novel lore entries or secrets — use manage_lore; ranking derived text or traversing the knowledge graph — use manage_knowledge.

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": {
      "action": "<action>"
    },
    "name": "manage_corpus"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYescorpus_register, corpus_list, corpus_get, corpus_route, corpus_grant, corpus_deny, corpus_access, corpus_consume, corpus_acquisitions.
corpus_bodyNoDocument reference text (corpus_register).
corpus_modeNoread, research, taught, or import (corpus_consume; default read).
corpus_titleNoDocument title (corpus_register).
corpus_deniesNoEntity ids explicitly denied access (corpus_register).
corpus_domainNoKnowledge domain (corpus_register/corpus_route/corpus_list).
corpus_grantsNoEntity ids explicitly granted access (corpus_register).
corpus_domainsNoKnowledge domains the entity may access (corpus_access).
corpus_entity_idNoEntity acquiring or inspected (corpus_consume/corpus_acquisitions/corpus_access/corpus_grant/corpus_deny).
corpus_document_idNoCorpus document id (corpus_get/corpus_route/corpus_grant/corpus_deny/corpus_consume).
corpus_access_publicNoWhether every entity may consume it (corpus_register; default false).
corpus_access_domainsNoKnowledge domains granted access (corpus_register).
corpus_source_profileNoTrusted source profile the domain is routed from (corpus_register; default manual).

Output Schema

NameRequiredDescriptionDefault
textNoHuman-readable text envelope mirroring the structured result (REQ-001, REQ-548a).
statusYesMachine-readable result status: OK, NEED_INPUT, WARNING, PARTIAL, or an error category (REQ-002, REQ-548c).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv2026.10.13
    • removedInput schema / properties / badge_scope
      Removed value: -{
      -  "description": "game_master or shared (set/update).",
      -  "enum": [
      -    "game_master",
      -    "shared"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / content
      Removed value: -{
      -  "description": "Lore content (set/update).",
      -  "type": "string"
      -}
    • removedInput schema / properties / data
      Removed value: -{
      -  "description": "JSON or Markdown lorebook data (import).",
      -  "type": "string"
      -}
    • removedInput schema / properties / entity_id
      Removed value: -{
      -  "description": "Entity to reveal to / whose knowledge to read (reveal/knowledge).",
      -  "type": "string"
      -}
    • removedInput schema / properties / format
      Removed value: -{
      -  "description": "Optional output format (export).",
      -  "type": "string"
      -}
    • removedInput schema / properties / group
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "description": "Group name, or null to clear (set/update/group)."
      -}
    • removedInput schema / properties / key
      Removed value: -{
      -  "description": "Lore key (set/update/remove/toggle/group/get).",
      -  "type": "string"
      -}
    • removedInput schema / properties / mode
      Removed value: -{
      -  "description": "dry-run, merge, or replace (import).",
      -  "enum": [
      -    "dry-run",
      -    "merge",
      -    "replace"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / priority
      Removed value: -{
      -  "description": "Optional priority (set/update).",
      -  "type": "number"
      -}
    • removedInput schema / properties / sticky
      Removed value: -{
      -  "description": "Optional sticky weight (set/update).",
      -  "type": "number"
      -}
    • removedInput schema / properties / triggers
      Removed value: -{
      -  "description": "Optional recall triggers (set/update).",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / world_target
      Removed value: -{
      -  "description": "Optional world-model target reference (set/set_secret).",
      -  "type": "string"
      -}
  2. Added
  3. Removedv1.0.5
  4. Addedv1.0.3

TDQS

A4.4/5.0
Behavior3/5

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

The description adds real value beyond the blanket destructiveHint=true annotation by telling the agent that only mutating actions persist access state, that they are audited, and that mutations are not undoable via manage_history — a critical safety fact the annotations cannot express. The per-action read-only carve-out (list, get, acquisitions) refines rather than contradicts the coarse destructive hint. It stops short of describing what an access decision change does to in-flight acquisitions or the response shape, leaving a modest gap for a destructive tool.

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?

Structure is strong and front-loaded: resource statement, per-action behavior, persistence/audit warning, undo caveat, then when/when-not blocks. The middle sentence is extremely dense and chains many clauses with semicolons, which costs readability slightly, but no sentence is filler.

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, 9-action destructive tool, the description covers action semantics, access precedence, audit/persistence, undo limitations, and sibling routing, and an output schema already exists so return values need not be described. Nothing an agent needs in order to select an action and call it correctly appears to be missing.

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; the description goes further by stating access precedence — an explicit deny overrides public, grant, and domain access — which is a semantic rule absent from the schema and directly affects how an agent should combine access_public, access_domains, grants, and denies. It also flags that access_public and the other access fields are optional at register time, though it leaves default values 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?

The description names the resource ('cold-reference knowledge corpus') and then enumerates each action with a specific effect: corpus_register indexes a document, corpus_route derives a domain, grant/deny add per-entity decisions, access sets a domain profile, consume records a read. It also explicitly distinguishes itself from manage_lore and manage_knowledge, so an agent can separate it from siblings 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?

There is an explicit 'Use when:' list covering registering, listing, reading, routing, granting/denying, consuming and inspecting acquisitions, and an explicit 'Do NOT use when:' clause routing lore writing to manage_lore and derived-text/graph work to manage_knowledge. When and when-not are both stated with named alternatives.

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