Skip to main content
Glama

get_all_pages

Retrieve all pages from a WikiJS knowledge base using the MCP server, enabling efficient content management and integration with AI assistants for seamless access to stored information.

Instructions

Get all pages in WikiJS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The createTool function that defines the handler for the 'get_all_pages' tool. It calls wikiClient.getAllPages(), formats the result as JSON text, or returns an error message.
    export const createTool = (wikiClient: WikiJSClient): ToolCallback<typeof PARAMETERS> => { return async () => { try { const result = await wikiClient.getAllPages(); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text', text: `Error getting page by ID: ${errorMessage}` } ], isError: true }; } } }
  • The input parameters schema for the 'get_all_pages' tool (empty object).
    export const PARAMETERS = {};
  • src/mcp/index.ts:61-66 (registration)
    Registration of the 'get_all_pages' tool on the MCP server using server.tool() with name, description, parameters, and the created handler function.
    server.tool( 'get_all_pages', 'Get all pages in WikiJS', GET_ALL_PAGES_TOOL_PARAMETERS, createGetAllPagesTool(this.wikiClient) );
  • The WikiJSClient.getAllPages helper method invoked by the tool handler, which calls the GraphQL SDK to fetch all pages.
    async getAllPages({limit, locale, tags}: {limit?: number, locale?: string, tags?: string[]} = {}) { const result = await this.sdk.GetAllPages({ limit, locale, tags }); return result.pages?.list || []; }

Other Tools

Related Tools

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/RicardoCenci/wikijs-mcp'

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