ask_wiki
Get answers to questions by retrieving relevant information from wiki content using RAG technology.
Instructions
Ask a question and get an answer based on wiki content using RAG.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes |
Implementation Reference
- src/lib/handlers/smart.ts:88-102 (handler)The main handler function for the 'ask_wiki' tool. It checks if brain features are enabled, queries the brain for an answer using RAG on wiki documents, and returns the answer along with source titles and URLs.async ask_wiki(args: { question: string }) { if (!brain.isEnabled()) { return { error: ERROR_MESSAGES.SMART_FEATURES_DISABLED }; } const { answer, sources } = await brain.ask(args.question); return { answer, sources: sources.map((s) => ({ title: s.title, url: s.url, })), }; },
- src/lib/schemas.ts:146-148 (schema)Zod input schema for the 'ask_wiki' tool, defining a required 'question' string parameter.export const askWikiSchema = z.object({ question: z.string().min(1, 'Question is required'), });
- src/lib/tools.ts:205-209 (registration)Registers the 'ask_wiki' tool in the MCP tool definitions array, providing name, description, and linking to the Zod schema.createTool( 'ask_wiki', 'Ask a question and get an answer based on wiki content using RAG.', 'ask_wiki' ),
- src/lib/handlers/index.ts:26-26 (registration)Spreads the smart handlers (including 'ask_wiki') from createSmartHandlers into the main ToolHandlers object used for tool execution....createSmartHandlers(ctx),