Skip to main content
Glama

get_page_by_id

Retrieve a specific WikiJS page by its unique ID using this tool, enabling quick content access and integration within the WikiJS MCP Server environment.

Instructions

Get a WikiJS page by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the page to retrieve

Implementation Reference

  • The MCP tool handler function that extracts the page ID from the request, fetches the page using the WikiJS client, stringifies the result as JSON text content, or returns an error message if failed.
    return async (request) => {
    	try {
    		const { id } = request;
    		const result = await wikiClient.getPageById(id);
    
    		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
    		};
    	}
    }
  • Zod schema defining the input parameters for the tool: a required numeric 'id'.
    export const PARAMETERS ={
        id: z.number().describe('The ID of the page to retrieve')
    };
  • src/mcp/index.ts:47-52 (registration)
    Registration of the 'get_page_by_id' tool on the MCP server, providing name, description, parameters schema, and the handler factory function.
    server.tool(
        'get_page_by_id',
        'Get a WikiJS page by its ID',
        GET_PAGE_BY_ID_TOOL_PARAMETERS,
        createGetPageByIdTool(this.wikiClient)
    );
  • Supporting method in WikiJSClient class that uses the GraphQL SDK to retrieve a page by its ID and returns the page data or null.
    async getPageById(id: number) {
      const result = await this.sdk.GetPageById({ id });
      return result.pages?.single || null;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic action ('Get') without detailing aspects like read-only nature (implied but not explicit), error handling (e.g., what happens if ID is invalid), or response format. This leaves significant gaps for a tool that retrieves data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words, making it highly efficient and front-loaded. It directly communicates the core purpose without unnecessary elaboration, which is ideal for conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is minimal but adequate for basic understanding. However, it lacks completeness for effective use: no output details, no error handling, and no differentiation from siblings. For a retrieval tool, this leaves the agent with insufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the parameter 'id' fully documented in the schema as 'The ID of the page to retrieve'. The description adds no additional semantic context beyond what the schema provides, such as ID format or examples. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('a WikiJS page by its ID'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_page_by_path' or 'search_pages' beyond the 'by ID' specification, which is implied but not contrasted.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_page_by_path' or 'search_pages'. The description assumes the user knows they need to retrieve by ID, but it doesn't clarify scenarios where ID is preferred over path or search, or mention prerequisites like needing the page ID.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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