Skip to main content
Glama

wpnav_list_posts

Retrieve and filter WordPress blog posts by status, search term, or pagination to view IDs, titles, statuses, and modification dates.

Instructions

List WordPress blog posts with optional filtering. Returns post ID, title, status, and last modified date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (default: 1)
per_pageNoNumber of posts to return (default: 10, max: 100)
statusNoFilter by status (default: publish)
searchNoSearch term to filter posts by title or content

Implementation Reference

  • Registration of the wpnav_list_posts tool via toolRegistry.register. Includes the tool definition (name, description, input schema), the handler function that fetches posts from WP REST API /wp/v2/posts with pagination/filtering, processes summaries using utilities, and returns formatted response. This is the core implementation.
    toolRegistry.register({ definition: { name: 'wpnav_list_posts', description: 'List WordPress blog posts with optional filtering. Returns post ID, title, status, and last modified date.', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number for pagination (default: 1)' }, per_page: { type: 'number', description: 'Number of posts to return (default: 10, max: 100)' }, status: { type: 'string', enum: ['publish', 'draft', 'private', 'any'], description: 'Filter by status (default: publish)' }, search: { type: 'string', description: 'Search term to filter posts by title or content' }, }, required: [], }, }, handler: async (args, context) => { const { page, per_page } = validatePagination(args); const status = args.status || 'publish'; const qs = buildQueryString({ page, per_page, status, search: args.search }); const posts = await context.wpRequest(`/wp/v2/posts?${qs}`); const summary = posts.map((p: any) => extractSummary(p, ['id', 'title.rendered', 'status', 'modified', 'link'])); return { content: [{ type: 'text', text: context.clampText(JSON.stringify(summary, null, 2)) }], }; }, category: ToolCategory.CONTENT, });
  • Static tool schema definition for wpnav_list_posts exported in tools array, likely used for MCP tool discovery or client-side validation. Matches the schema in the dynamic registration.
    name: 'wpnav_list_posts', description: 'List WordPress blog posts with optional filtering. Returns post ID, title, status, and last modified date.', inputSchema: { type: 'object' as const, properties: { per_page: { type: 'number' as const, description: 'Number of posts to return (default: 10, max: 100)', default: 10, }, page: { type: 'number' as const, description: 'Page number for pagination (default: 1)', default: 1, }, status: { type: 'string' as const, description: 'Filter by status: publish, draft, private, or any', enum: ['publish', 'draft', 'private', 'any'], default: 'publish', }, search: { type: 'string' as const, description: 'Search term to filter posts by title or content', }, }, required: [], },

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