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 core handler function for the 'ask_wiki' tool. It checks if the brain (AI/vector store) is enabled, then queries it with the user's question using RAG to retrieve an answer and relevant sources.
    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 the 'ask_wiki' tool: requires a 'question' string.
    export const askWikiSchema = z.object({ question: z.string().min(1, 'Question is required'), });
  • Registers the smart handlers (including 'ask_wiki') by spreading createSmartHandlers into the full set of tool handlers.
    export function createAllHandlers(ctx: AppContext): ToolHandlers { return { ...createSearchHandlers(ctx), ...createDocumentHandlers(ctx), ...createCollectionHandlers(ctx), ...createCommentHandlers(ctx), ...createBatchHandlers(ctx), ...createSmartHandlers(ctx), } as ToolHandlers; }
  • Registers the 'ask_wiki' tool definition for MCP, including name, description, and schema reference.
    createTool( 'ask_wiki', 'Ask a question and get an answer based on wiki content using RAG.', 'ask_wiki' ),
  • Maps the 'ask_wiki' tool name to its Zod schema in the central toolSchemas object.
    ask_wiki: askWikiSchema,

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