Autonomous coding agents interacting with modern knowledge bases require rigorous tool selection protocols. When an agent chooses an improperly scoped tool, it incurs severe context pollution, latency spikes, or catastrophic authorization rejections. Wikantik exposes exactly 51 distinct Model Context Protocol (MCP) tools distributed across two cryptographically partitioned server interfaces: 22 read-only tools on /knowledge-mcp and 29 privileged write, curation, and analytical tools on /wikantik-admin-mcp.
While simple agent implementations treat an MCP server as an undifferentiated bag of functions, production agentic architectures—such as those operating across the Simple Agility ecosystem—leverage strict functional decision trees. This runbook provides the definitive operational decision procedure, routing taxonomy, token economic equations, and error recovery workflows necessary to navigate Wikantik's dual-MCP surface with maximal precision and minimal token expenditure.
graph TD
A["Agent Intent Received"] --> B{"Requires Mutation or Admin Analytics?"}
%% Write Branch
B -- "Yes (Write / Mutate / Curate)" --> C["Authenticate on /wikantik-admin-mcp (mcp_admin Key)"]
C --> D{"Mutation Category"}
D -- "Create New Pages" --> D1["write_pages (Batch Creation)"]
D -- "Edit Existing Content" --> D2["update_page (Optimistic Locking + removeKeys)"]
D -- "Taxonomy / Cluster Refactor" --> D3["rename_cluster or rename_page"]
D -- "Verification Gate" --> D4["verify_pages → mark_page_verified"]
D -- "Knowledge Graph Curation" --> D5["curate_nodes / curate_edges"]
D -- "Traffic & Query Signals" --> D6["list_content_opportunities / list_retrieval_queries"]
%% Read Branch
B -- "No (Read-Only Grounding)" --> E["Authenticate on /knowledge-mcp (mcp_read Key)"]
E --> F{"Information Goal"}
F -- "Answer Specific Question" --> F1["assemble_bundle (Check coverage.confidence)"]
F -- "Discover Relevant Pages" --> F2["retrieve_context (Query-driven Chunks)"]
F -- "Metadata & Structural Faceting" --> F3["list_pages_by_filter (Cluster / Tag / Freshness)"]
F -- "Page Orientation & Verification" --> F4["get_page_for_agent (Token-Budgeted Projection)"]
F -- "Deep Code / Content Extraction" --> F5["read_pages (Batched Raw Markdown, ≤20 pages)"]
F -- "Entity Triples & Ontological Graph" --> F6["traverse / query_nodes / sparql_query"]
Wikantik partitions its MCP tools into two distinct server endpoints. This bifurcation enforces the principle of least privilege, protects sensitive corpus telemetry, and optimizes transport serialization over HTTP Server-Sent Events (SSE).
Every interaction begins with an HTTP POST JSON-RPC handshake against the appropriate endpoint:
/knowledge-mcp):
mcp_read authorization. If an agent presents an invalid or administrative token, it is accepted under read constraints; however, attempting any mutating operation returns JSON-RPC Method Not Found (-32601)./knowledge-mcp./wikantik-admin-mcp):
mcp_admin authorization. Presenting an mcp_read token immediately results in an HTTP 403 Forbidden status code.expectedContentHash), preventing concurrent agent overwrites.Both endpoints follow the standard Model Context Protocol transport specification over HTTP:
initialize): The agent sends client identification (clientInfo) and negotiated protocol version (2024-11-05). The server responds with server metadata, supported capabilities, and issues an Mcp-Session-Id header.Mcp-Session-Id header across all subsequent POST requests within the same operational loop to maintain stateful cache bindings and avoid redundant token-bucket initializations.text/event-stream format with JSON-RPC envelopes emitted on standard data: lines.When an agent needs to retrieve data or mutate state, it must evaluate three sequential branching criteria:
/wikantik-admin-mcp. Ensure the active environment provides WIKANTIK_ADMIN_API_KEY./knowledge-mcp. Use WIKANTIK_KNOWLEDGE_API_KEY.assemble_bundle. It executes hybrid BM25 + dense vector retrieval, deduplicates overlapping passages, and emits a composite text bundle.retrieve_context. It returns scored page names and excerpt coordinates.list_pages_by_filter. Do not use search tools for faceted enumeration.get_page_for_agent.read_pages (supporting up to 20 slugs in a single batched network round-trip).query_nodes or sparql_query.write_pages. It enforces atomic creation and rejects pages that already exist, preventing inadvertent overwrites.update_page. Always supply the existing content hash to enable optimistic locking. Use removeKeys to prune deprecated frontmatter fields like hubs.rename_cluster or rename_page. Never manually edit frontmatter cluster: across dozens of files individually; rename_cluster cascades across all member pages automatically.verify_pages to run structural sanity checks, followed by mark_page_verified to stamp confidence headers./knowledge-mcpThe read server exposes 22 specialized tools designed to satisfy the spectrum between high-level orientation and deep graph queries.
| Tool Name | Primary Functional Intent | Key Input Arguments | Response Shape | Average Token Footprint | Escalation / Fallback Path |
|---|---|---|---|---|---|
assemble_bundle | Grounded question answering | query, max_tokens (opt) | Ranked, deduplicated sections + confidence | 1,200 – 3,500 tokens | If confidence is sparse, escalate to retrieve_context |
retrieve_context | Discovering relevant pages/chunks | query, limit (default 5) | Scored list of page slugs and text snippets | 400 – 800 tokens | Read surfaced slugs via read_pages |
get_page_for_agent | Token-budgeted orientation | canonical_id or slug | Structured JSON: facts, outline, hints | 350 – 500 tokens | If full prose needed, escalate to read_pages |
read_pages | Batched raw markdown ingestion | pages (array of slugs, ≤20) | Map of {slug: {content, version, hash}} | 1,500 – 15,000+ tokens | Handle per-page not_found errors |
list_pages_by_filter | Structural taxonomy filtering | cluster, type, tags | Array of page descriptors with canonical IDs | 200 – 600 tokens | Pass canonical_id into get_page_for_agent |
get_page_neighbors | Graph link neighborhood exploration | pageName, direction | Inbound wikilinks, outbound wikilinks | 150 – 400 tokens | Traverses Page Graph without reading bodies |
traverse | Co-mention Knowledge Graph walk | seedNode, maxDepth | Entity sub-graph, node attributes, edge types | 500 – 1,200 tokens | Use query_nodes if seed node is unknown |
sparql_query | Formal RDF/OWL ontology reasoning | query (valid SPARQL) | SPARQL JSON result set (bindings) | 250 – 900 tokens | Inspect schema with get_ontology first |
assemble_bundle Confidence ProtocolWhen executing assemble_bundle, autonomous agents must not treat the output as raw, unquestioned truth. The tool returns a vital metadata block: coverage.confidence.
{
"coverage": {
"confidence": "strong",
"directMatches": 4,
"semanticClusters": ["agentic-coding", "context-engineering"],
"scoreThreshold": 0.742
},
"bundle": "### AgenticCodingHub > Structural Spine\n..."
}
strong Confidence: The retrieval engine located direct, highly ranked semantic matches across multiple authoritative sections. The agent may synthesize its response immediately.moderate Confidence: The bundle contains relevant context, but some query sub-aspects were weakly matched. The agent should supplement the bundle by querying retrieve_context or inspecting cluster neighbors via get_page_neighbors.sparse Confidence: The wiki lacks sufficient density on the requested topic. The agent should refrain from hallucinating, report the knowledge gap, and check list_content_opportunities on the admin server./wikantik-admin-mcpThe admin server exposes 29 privileged tools governing document creation, mutation, schema migration, and graph curation.
| Tool Name | Operation Class | Concurrency Control | Validation Gates | Primary Failure Modes |
|---|---|---|---|---|
write_pages | Batch document creation | Fails if slug already exists | Frontmatter schema validation | 409 Conflict if page exists; use update_page |
update_page | Optimistic document mutation | Compares expectedContentHash | Server frontmatter schema, KaTeX checks | 412 Precondition Failed on hash mismatch |
rename_page | Page slug migration | Acquires page lock | Automated backlink rewrites | Broken links if referencing pages are locked |
rename_cluster | Bulk taxonomy migration | Mutates all cluster members | Validates cluster slug format | Long execution time across large clusters |
verify_pages | Batch health auditing | Read-only admin audit | Existence, SEO metadata, KaTeX rules | Returns warning arrays; does not fail HTTP |
mark_page_verified | Authoritative verification | Writes audit timestamps | Requires human/agent verification ID | Rejection if required checklist criteria fail |
curate_nodes | Knowledge Graph entity update | Transactional batch | Node type constraints, URI formats | Schema validation rejection on invalid types |
curate_edges | Knowledge Graph edge update | Transactional batch | Subject/object entity existence | Dangling edge rejection |
The most critical write operation is update_page. To prevent race conditions between concurrent agents or human editors, update_page implements strict optimistic concurrency control:
{
"pageName": "SkillsVsMcp",
"expectedContentHash": "93c27087ed727cdfa4d8b95055f30cfdf1a4ba71b8bbb4c6be1532c7ea57cec4",
"content": "---\nstatus: active\n...",
"frontmatter": {
"status": "active",
"cluster": "agentic-coding"
},
"removeKeys": ["hubs", "legacy_category"]
}
expectedContentHash: The SHA-256 hash of the page content as received during the read phase. If another agent or user has modified the page in the interim, the server rejects the update with 412 Precondition Failed.removeKeys: Explicitly unsets deprecated frontmatter fields. This provides safe, server-authoritative schema pruning (e.g., eliminating retired hubs: fields under the Wikantik v2.4+ Cluster Declaration Architecture).A central design failure in autonomous agent workflows is the unbudgeted consumption of raw markdown. When an agent reads full articles simply to discover metadata, verify citations, or extract section headers, it rapidly exhausts the active context window.
The total token cost of a multi-turn agent interaction across N wiki interactions is defined as:
Where:
When an agent invokes read_pages for an average deep-dive article (approximately 2,200 words or 2,900 tokens), the payload consumes substantial budget. Conversely, the agent projection emitted by get_page_for_agent emits only the compressed structural spine (approximately 350 words or 460 tokens).
We define the Projection Token Efficiency Ratio as:
By routing orientation steps to get_page_for_agent, the agent achieves an 84.1% reduction in context consumption per orientation step. Over a 20-step autonomous research and curation trajectory, this preserves over 48,000 tokens, directly reducing inference costs from approximately $0.15 per session to less than $0.024 per session while eliminating prompt truncation and attention degradation.
The following concrete JSON-RPC payloads demonstrate compliant invocations across both endpoints.
assemble_bundle# POST /knowledge-mcp
{
"jsonrpc": "2.0",
"id": 101,
"method": "tools/call",
"params": {
"name": "assemble_bundle",
"arguments": {
"query": "How do Simple Agility coding agents verify PRs before merging?",
"max_tokens": 2500
}
}
}
get_page_for_agent# POST /knowledge-mcp
{
"jsonrpc": "2.0",
"id": 102,
"method": "tools/call",
"params": {
"name": "get_page_for_agent",
"arguments": {
"pageName": "SpecDrivenDevelopment"
}
}
}
update_page# POST /wikantik-admin-mcp
{
"jsonrpc": "2.0",
"id": 201,
"method": "tools/call",
"params": {
"name": "update_page",
"arguments": {
"pageName": "SpecDrivenDevelopment",
"expectedContentHash": "a4f89d3c2b1e7f60...",
"content": "---\ntitle: Spec-Driven Development\n...",
"removeKeys": ["hubs"]
}
}
}
verify_pages# POST /wikantik-admin-mcp
{
"jsonrpc": "2.0",
"id": 202,
"method": "tools/call",
"params": {
"name": "verify_pages",
"arguments": {
"pageNames": ["SpecDrivenDevelopment", "SkillsVsMcp", "ContextEngineeringForCodingAgents"]
}
}
}
get_page Void Traversalget_page expecting the article's markdown prose. It receives only a sparse JSON descriptor containing frontmatter metadata and a canonical URL. The agent then repeatedly re-queries or hallucinates the content.get_page only when verifying frontmatter attributes or URL coordinates. For token-budgeted reading, call get_page_for_agent; for full markdown, call read_pages.read_pages. This injects 30,000+ tokens into the conversation history, overwhelming the model's context window.assemble_bundle first. Allow Wikantik's server-side ranking engine to extract and deduplicate the top 5 relevant sections into a single compact bundle.update_page or mark_page_verified on /knowledge-mcp, or attempts to use an mcp_read key on /wikantik-admin-mcp./knowledge-mcp and all write tools target /wikantik-admin-mcp.find_similar or search_knowledge to search for document paragraphs or tutorials.search_knowledge and find_similar operate strictly over Knowledge Graph entity nodes (concepts, organizations, specifications). Document text retrieval must be routed through retrieve_context or assemble_bundle.update_page call without providing expectedContentHash. If an intervening edit occurred, the prior work is silently overwritten.412 Precondition Failed by performing a three-way diff.