Skip to main content
Glama

wpnav_get_page

Retrieve a WordPress page by ID to access its full content, metadata, and edit history for management purposes.

Instructions

Get a single WordPress page by ID. Returns full page content, metadata, and edit history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWordPress page ID

Implementation Reference

  • Handler function for wpnav_get_page tool. Validates the page ID, fetches the page data from the WordPress REST API endpoint `/wp/v2/pages/${id}`, extracts a summary of key fields using extractSummary utility, and returns a formatted JSON response clamped for length.
    handler: async (args, context) => { validateRequired(args, ['id']); const id = validateId(args.id, 'Page'); const page = await context.wpRequest(`/wp/v2/pages/${id}`); const summary = extractSummary(page, [ 'id', 'title.rendered', 'content.rendered', 'status', 'author', 'modified', 'link', 'template', 'parent', 'menu_order', ]); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(summary, null, 2)) }], }; },
  • Input schema definition for wpnav_get_page, requiring a numeric 'id' parameter.
    inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'WordPress page ID' }, }, required: ['id'], },
  • Full tool registration block for wpnav_get_page using toolRegistry.register, including definition (name, description, schema), handler, and category.
    toolRegistry.register({ definition: { name: 'wpnav_get_page', description: 'Get a single WordPress page by ID. Returns full page content, metadata, and edit history.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'WordPress page ID' }, }, required: ['id'], }, }, handler: async (args, context) => { validateRequired(args, ['id']); const id = validateId(args.id, 'Page'); const page = await context.wpRequest(`/wp/v2/pages/${id}`); const summary = extractSummary(page, [ 'id', 'title.rendered', 'content.rendered', 'status', 'author', 'modified', 'link', 'template', 'parent', 'menu_order', ]); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(summary, null, 2)) }], }; }, category: ToolCategory.CONTENT, });
  • Tool schema stub in the main tools export array, used for MCP schema discovery and client-side validation.
    { name: 'wpnav_get_page', description: 'Get a single WordPress page by ID. Returns full page content, metadata, and edit history.', inputSchema: { type: 'object' as const, properties: { id: { type: 'number' as const, description: 'WordPress page ID', }, }, required: ['id'], },

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/littlebearapps/wp-navigator-mcp'

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