Skip to main content
Glama

get_page_by_path

Retrieve a specific WikiJS page by providing its path and locale, enabling precise content access within WikiJS knowledge bases.

Instructions

Get a WikiJS page by its path and locale

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
localeYesThe locale of the page (e.g., "en")
pathYesThe path of the page to retrieve

Implementation Reference

  • Factory function createGetPageByPathTool that returns the tool handler executing the get_page_by_path logic: extracts path/locale, calls wikiClient.getPageByPath, returns JSON content or error.
    export const createTool = (wikiClient: WikiJSClient): ToolCallback<typeof PARAMETERS> => { return async (request) => { try { const { path, locale } = request; const result = await wikiClient.getPageByPath(path, locale); 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 path: ${errorMessage}` } ], isError: true }; } } }
  • Zod schema defining input parameters for the get_page_by_path tool: path (string) and locale (string with format validation).
    export const PARAMETERS = { path: z.string().describe('The path of the page to retrieve'), locale: z.string().regex(/^[a-z]{2}(-[A-Z]{2})?$/, 'Invalid locale format').describe('The locale of the page (e.g., "en")') }
  • src/mcp/index.ts:54-59 (registration)
    Registration of the get_page_by_path tool on the MCP server using server.tool, providing name, description, parameters schema, and handler factory.
    server.tool( 'get_page_by_path', 'Get a WikiJS page by its path and locale', GET_PAGE_BY_PATH_TOOL_PARAMETERS, createGetPageByPathTool(this.wikiClient) );
  • WikiJSClient helper method getPageByPath that invokes the GraphQL SDK to fetch the page by path and locale, used by the tool handler.
    async getPageByPath(path: string, locale: string) { const result = await this.sdk.GetPageByPath({ path, locale }); return result.pages?.singleByPath || null; }

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