Skip to main content
Glama

wpnav_gutenberg_list_patterns

Discover available Gutenberg block patterns and reusable blocks to quickly implement pre-designed layouts in WordPress content.

Instructions

List all available Gutenberg block patterns and reusable blocks. Patterns are pre-designed block combinations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function executes the tool logic by fetching Gutenberg patterns from the WP REST API '/wpnav/v1/gutenberg/patterns', handles errors, formats the patterns summary, and returns a structured response.
    handler: async (args, context) => { const result = await context.wpRequest('/wpnav/v1/gutenberg/patterns'); if (!result.success) { return { content: [{ type: 'text', text: context.clampText(JSON.stringify({ error: result.error }, null, 2)), }], isError: true, }; } // Format patterns for display const summary = result.patterns.map((p: any) => ({ id: p.id, title: p.title, type: p.type, categories: p.categories, })); return { content: [{ type: 'text', text: context.clampText(JSON.stringify({ success: true, count: result.patterns.length, patterns: summary, }, null, 2)), }], }; },
  • The tool definition including name, description, and input schema (no required parameters).
    definition: { name: 'wpnav_gutenberg_list_patterns', description: 'List all available Gutenberg block patterns and reusable blocks. Patterns are pre-designed block combinations.', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • The registration of the 'wpnav_gutenberg_list_patterns' tool in the toolRegistry, including definition, handler, and category.
    toolRegistry.register({ definition: { name: 'wpnav_gutenberg_list_patterns', description: 'List all available Gutenberg block patterns and reusable blocks. Patterns are pre-designed block combinations.', inputSchema: { type: 'object', properties: {}, required: [], }, }, handler: async (args, context) => { const result = await context.wpRequest('/wpnav/v1/gutenberg/patterns'); if (!result.success) { return { content: [{ type: 'text', text: context.clampText(JSON.stringify({ error: result.error }, null, 2)), }], isError: true, }; } // Format patterns for display const summary = result.patterns.map((p: any) => ({ id: p.id, title: p.title, type: p.type, categories: p.categories, })); return { content: [{ type: 'text', text: context.clampText(JSON.stringify({ success: true, count: result.patterns.length, patterns: summary, }, null, 2)), }], }; }, category: ToolCategory.CONTENT, });

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