Skip to content

MCP Tools Reference

PieKBS exposes three MCP tools for agents.

Search the knowledge base with a keyword or phrase.

Parameters:

ParameterTypeRequiredDescription
querystringyesSearch keyword or phrase
kindstringnoFilter page kind: source-note, concept, comparison, decision
layerstringnoFilter layer: wiki, raw, or schema
limitnumbernoMaximum results (default 10)

Returns: Ranked list of matching pages, each with:

  • id — page identifier for use with kb_page
  • title, snippet — preview of the matched content
  • kind, layer — page classification
  • related — linked documents for graph navigation

Example:

json
{
  "query": "RAG retrieval augmented generation",
  "limit": 5
}

kb_add

Add a text document to the knowledge base.

Parameters:

ParameterTypeRequiredDescription
filenamestringyesPath relative to raw/. Use any subdirectory structure (e.g. references/article.md, converted/report.md). Use converted/ prefix for agent-extracted PDF/Word/Excel/EPUB content.
contentstringyesFile content (Markdown or plain text)
source_urlstringnoOriginal source URL, written as a comment at the top of the file
overwritebooleannoOverwrite if file already exists (default false)

Writes content to raw/<filename> and triggers incremental indexing. Distillation runs asynchronously in the background.

Example:

json
{
  "filename": "references/my-article.md",
  "content": "# My Article\n\nContent here...",
  "source_url": "https://example.com/article"
}

kb_page

Fetch full content of one or more pages by ID.

Parameters:

ParameterTypeRequiredDescription
idsarrayyesDocument IDs from kb_search results (1–5)
fullbooleannoReturn complete untruncated text (only with single ID)

Returns: Full Markdown content of each requested page.

Example:

json
{
  "ids": ["source-notes/my-doc", "concepts/rag-overview"],
  "full": false
}

Released under the MIT License.