Skip to main content
Glama

ask_wiki

Get answers to questions by querying wiki content through RAG-powered search, enabling knowledge retrieval from documentation.

Instructions

Ask a question and get an answer based on wiki content using RAG.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes

Implementation Reference

  • The core execution logic for the 'ask_wiki' tool. Validates brain availability, performs RAG query via brain.ask, and formats response with answer and source links.
    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 schema defining the input for ask_wiki: requires a non-empty question string.
    export const askWikiSchema = z.object({ question: z.string().min(1, 'Question is required'), });
  • Registers the 'ask_wiki' tool definition for MCP, linking name, description, and input schema.
    createTool( 'ask_wiki', 'Ask a question and get an answer based on wiki content using RAG.', 'ask_wiki' ),
  • Includes the smart handlers (containing ask_wiki) into the main ToolHandlers object.
    ...createSmartHandlers(ctx), } as ToolHandlers;

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-smart-mcp'

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