Skip to content

query_knowledge_base

Semantic search over the project's configured knowledge base (product docs, policy pages, internal wiki). Scoped to the project's configured domains. Returns excerpts with source URLs. If the project hasn't enabled a knowledge base, returns an error explaining so.

Parameters

Parameter Type Required Default Description
query string yes Search query (natural language).
limit integer no 5 Max results. Default: 5.

Example call

from fastmcp import Client
from fastmcp.client.auth import BearerAuth

async with Client(
    "https://mcp.chordia.ai/mcp",
    auth=BearerAuth("YOUR_APPLICATION_KEY"),
) as client:
    result = await client.call_tool(
        "query_knowledge_base",
        {
            "query": "your search text"
        },
    )
    print(result.content[0].text)
# Plus any of the 1 optional params from the table above.

In Claude Desktop, Cursor, or any MCP-aware client the same call is issued by the LLM automatically once the server is configured — see integrations.

Result

Success responses are JSON of the shape below. Optional fields are omitted when the underlying data isn't present.

{
  "items": [
    {
      "kb_id": "kb_001",
      "title": "Refund policy",
      "snippet": "Customers may request a refund within 30 days...",
      "score": 0.87
    }
  ],
  "count": 1
}

Auth context

Every call receives the connection's project_id and access_scope automatically — the caller never passes them. See Authentication & RBAC for how scope narrows results.

Errors

All tools return JSON. Errors are wrapped in { "error": "..." }. The most common shapes are documented in Python integration → Error shape.