Skip to main content
Glama

wpnav_get_site_overview

Retrieve comprehensive WordPress site overview including version, themes, plugins, content, and user data in a single API call for efficient site analysis.

Instructions

Get a comprehensive site overview including WordPress version, theme info, plugin counts, content summary, and user counts by role. Designed for AI agents to quickly understand site structure without multiple API calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for wpnav_get_site_overview fetches site settings, theme, plugins, content counts, users, and categories/tags in parallel using wpRequest. It processes the data to summarize theme info, plugin counts, user roles, and builds a comprehensive JSON overview of the site, returning it as text content.
    handler: async (args, context) => { const { wpRequest, config } = context; // Fetch data from multiple endpoints in parallel const [ siteSettings, activeTheme, plugins, posts, pages, media, users, categories, tags, ] = await Promise.all([ // Site settings (name, description, URL) wpRequest('/wp/v2/settings').catch(() => ({})), // Active theme wpRequest('/wp/v2/themes?status=active').catch(() => []), // All plugins wpRequest('/wp/v2/plugins').catch(() => []), // Post count (just need total from headers, fetch 1) wpRequest('/wp/v2/posts?per_page=1&_fields=id').catch(() => []), // Page count wpRequest('/wp/v2/pages?per_page=1&_fields=id').catch(() => []), // Media count wpRequest('/wp/v2/media?per_page=1&_fields=id').catch(() => []), // Users (to count by role) wpRequest('/wp/v2/users?per_page=100&_fields=id,roles').catch(() => []), // Categories count wpRequest('/wp/v2/categories?per_page=1&_fields=id').catch(() => []), // Tags count wpRequest('/wp/v2/tags?per_page=1&_fields=id').catch(() => []), ]); // Process theme info const theme = Array.isArray(activeTheme) && activeTheme.length > 0 ? activeTheme[0] : null; const themeInfo: Record<string, unknown> = {}; if (theme) { themeInfo.name = theme.name?.rendered || theme.stylesheet || 'Unknown'; themeInfo.version = theme.version || 'Unknown'; themeInfo.stylesheet = theme.stylesheet || ''; if (theme.template && theme.template !== theme.stylesheet) { themeInfo.parent_theme = theme.template; themeInfo.is_child_theme = true; } else { themeInfo.is_child_theme = false; } } // Process plugin counts const pluginList = Array.isArray(plugins) ? plugins : []; const activePlugins = pluginList.filter((p: any) => p.status === 'active'); const inactivePlugins = pluginList.filter((p: any) => p.status === 'inactive'); // Process user counts by role const userList = Array.isArray(users) ? users : []; const usersByRole: Record<string, number> = {}; for (const user of userList) { const roles = Array.isArray(user.roles) ? user.roles : []; for (const role of roles) { usersByRole[role] = (usersByRole[role] || 0) + 1; } } // Build overview response const overview = { site: { name: siteSettings.title || 'Unknown', description: siteSettings.description || '', url: config.baseUrl, admin_email: siteSettings.email || '', }, wordpress: { // Note: WP version requires introspect endpoint api_version: 'v2', rest_url: config.restApi, }, theme: Object.keys(themeInfo).length > 0 ? themeInfo : null, plugins: { total: pluginList.length, active: activePlugins.length, inactive: inactivePlugins.length, }, content: { posts: Array.isArray(posts) ? 'available' : 'error', pages: Array.isArray(pages) ? 'available' : 'error', media: Array.isArray(media) ? 'available' : 'error', categories: Array.isArray(categories) ? 'available' : 'error', tags: Array.isArray(tags) ? 'available' : 'error', }, users: { total: userList.length, by_role: usersByRole, }, config: { writes_enabled: config.toggles.enableWrites, timeout_ms: config.toggles.toolTimeoutMs, }, }; return { content: [ { type: 'text', text: JSON.stringify(overview, null, 2), }, ], }; },
  • The tool registration in toolRegistry.register includes the definition with name, description, empty inputSchema, inline handler, and category CORE.
    toolRegistry.register({ definition: { name: 'wpnav_get_site_overview', description: 'Get a comprehensive site overview including WordPress version, theme info, plugin counts, content summary, and user counts by role. Designed for AI agents to quickly understand site structure without multiple API calls.', inputSchema: { type: 'object', properties: {}, required: [], }, }, handler: async (args, context) => { const { wpRequest, config } = context; // Fetch data from multiple endpoints in parallel const [ siteSettings, activeTheme, plugins, posts, pages, media, users, categories, tags, ] = await Promise.all([ // Site settings (name, description, URL) wpRequest('/wp/v2/settings').catch(() => ({})), // Active theme wpRequest('/wp/v2/themes?status=active').catch(() => []), // All plugins wpRequest('/wp/v2/plugins').catch(() => []), // Post count (just need total from headers, fetch 1) wpRequest('/wp/v2/posts?per_page=1&_fields=id').catch(() => []), // Page count wpRequest('/wp/v2/pages?per_page=1&_fields=id').catch(() => []), // Media count wpRequest('/wp/v2/media?per_page=1&_fields=id').catch(() => []), // Users (to count by role) wpRequest('/wp/v2/users?per_page=100&_fields=id,roles').catch(() => []), // Categories count wpRequest('/wp/v2/categories?per_page=1&_fields=id').catch(() => []), // Tags count wpRequest('/wp/v2/tags?per_page=1&_fields=id').catch(() => []), ]); // Process theme info const theme = Array.isArray(activeTheme) && activeTheme.length > 0 ? activeTheme[0] : null; const themeInfo: Record<string, unknown> = {}; if (theme) { themeInfo.name = theme.name?.rendered || theme.stylesheet || 'Unknown'; themeInfo.version = theme.version || 'Unknown'; themeInfo.stylesheet = theme.stylesheet || ''; if (theme.template && theme.template !== theme.stylesheet) { themeInfo.parent_theme = theme.template; themeInfo.is_child_theme = true; } else { themeInfo.is_child_theme = false; } } // Process plugin counts const pluginList = Array.isArray(plugins) ? plugins : []; const activePlugins = pluginList.filter((p: any) => p.status === 'active'); const inactivePlugins = pluginList.filter((p: any) => p.status === 'inactive'); // Process user counts by role const userList = Array.isArray(users) ? users : []; const usersByRole: Record<string, number> = {}; for (const user of userList) { const roles = Array.isArray(user.roles) ? user.roles : []; for (const role of roles) { usersByRole[role] = (usersByRole[role] || 0) + 1; } } // Build overview response const overview = { site: { name: siteSettings.title || 'Unknown', description: siteSettings.description || '', url: config.baseUrl, admin_email: siteSettings.email || '', }, wordpress: { // Note: WP version requires introspect endpoint api_version: 'v2', rest_url: config.restApi, }, theme: Object.keys(themeInfo).length > 0 ? themeInfo : null, plugins: { total: pluginList.length, active: activePlugins.length, inactive: inactivePlugins.length, }, content: { posts: Array.isArray(posts) ? 'available' : 'error', pages: Array.isArray(pages) ? 'available' : 'error', media: Array.isArray(media) ? 'available' : 'error', categories: Array.isArray(categories) ? 'available' : 'error', tags: Array.isArray(tags) ? 'available' : 'error', }, users: { total: userList.length, by_role: usersByRole, }, config: { writes_enabled: config.toggles.enableWrites, timeout_ms: config.toggles.toolTimeoutMs, }, }; return { content: [ { type: 'text', text: JSON.stringify(overview, null, 2), }, ], }; }, category: ToolCategory.CORE, });
  • The input schema is an empty object with no properties or required fields.
    inputSchema: { type: 'object', properties: {}, 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