getKnowledge
Retrieve structured knowledge entries from a specific topic to access organized information from a version-controlled repository.
Instructions
Get all entries from a specific knowledge topic. Use listTopics first to see available topics.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | Topic name (e.g. typescript, docker, project-setup) |
Implementation Reference
- src/core/knowledge.ts:81-84 (handler)The core logic for retrieving knowledge, which fetches the topic file and parses it into entries.
async getTopic(topic: string): Promise<{ topic: string; entries: KnowledgeEntry[] }> { const file = await this.client.getFile(this.topicPath(topic)); return { topic, entries: parseEntries(file.content) }; } - src/tools/knowledge.ts:19-29 (registration)Registration of the 'getKnowledge' tool with the MCP server, mapping it to the 'getTopic' handler.
server.registerTool( "getKnowledge", { description: "Get all entries from a specific knowledge topic. Use listTopics first to see available topics.", inputSchema: { topic: z.string().describe("Topic name (e.g. typescript, docker, project-setup)"), }, }, toolHandler("getKnowledge", async ({ topic }) => kb.getTopic(topic)) );