Skip to main content
Glama

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
NameRequiredDescriptionDefault
questionYes

Implementation Reference

  • 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, })), }; },
  • 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'), });
  • 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' ),
  • Spreads the smart handlers (including 'ask_wiki') from createSmartHandlers into the main ToolHandlers object used for tool execution.
    ...createSmartHandlers(ctx),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huiseo/outline-wiki-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server