wp_get_site_settings
Retrieve general WordPress site settings to configure and manage your website's core parameters and operational preferences.
Instructions
Retrieves the general settings for a WordPress site.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | The ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured. |
Implementation Reference
- src/tools/site.ts:136-192 (handler)The core handler function for the wp_get_site_settings tool. It retrieves general WordPress site settings using the WordPressClient, computes additional information like current timezone-aware time and start of week day, and formats everything into a comprehensive Markdown report with sections for basic info, localization, date/time formats, content settings, and discussion settings.public async handleGetSiteSettings(client: WordPressClient, _params: Record<string, unknown>): Promise<unknown> { try { const settings = await client.getSiteSettings(); const siteUrl = client.getSiteUrl(); // Enhanced site settings with comprehensive details const weekDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; const startOfWeek = settings.start_of_week !== undefined ? weekDays[settings.start_of_week] : "Not set"; // Get additional site information const currentTime = new Date().toLocaleString("en-US", { timeZone: settings.timezone || "UTC", weekday: "long", year: "numeric", month: "long", day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: "short", }); let content = `**🌐 Site Settings for ${siteUrl}**\n\n`; content += `**📋 Basic Information:**\n`; content += `- **Title:** ${settings.title || "Not set"}\n`; content += `- **Description:** ${settings.description || "Not set"}\n`; content += `- **URL:** ${settings.url || siteUrl}\n`; content += `- **Admin Email:** ${settings.email || "Not set"}\n\n`; content += `**🌍 Localization:**\n`; content += `- **Language:** ${settings.language || "English (US)"}\n`; content += `- **Timezone:** ${settings.timezone || "UTC"}\n`; content += `- **Current Time:** ${currentTime}\n\n`; content += `**📅 Date & Time Format:**\n`; content += `- **Date Format:** ${settings.date_format || "Not set"}\n`; content += `- **Time Format:** ${settings.time_format || "Not set"}\n`; content += `- **Start of Week:** ${startOfWeek}\n\n`; content += `**📝 Content Settings:**\n`; content += `- **Posts per Page:** ${settings.posts_per_page || "Not set"}\n`; content += `- **Default Category:** ${settings.default_category || "Not set"}\n`; content += `- **Default Post Format:** ${settings.default_post_format || "Standard"}\n\n`; content += `**💬 Discussion Settings:**\n`; content += `- **Default Comment Status:** ${settings.default_comment_status || "Not set"}\n`; content += `- **Default Ping Status:** ${settings.default_ping_status || "Not set"}\n`; content += `- **Use Smilies:** ${settings.use_smilies ? "Yes" : "No"}\n\n`; content += `**📊 Retrieved:** ${new Date().toLocaleString()}`; return content; } catch (_error) { throw new Error(`Failed to get site settings: ${getErrorMessage(_error)}`); } }
- src/tools/site.ts:28-33 (registration)Registration of the wp_get_site_settings tool within the SiteTools.getTools() method, including name, description, empty parameters schema (no inputs required), and binding to the handler method.{ name: "wp_get_site_settings", description: "Retrieves the general settings for a WordPress site.", parameters: [], handler: this.handleGetSiteSettings.bind(this), },
- src/tools/site.ts:31-31 (schema)Schema definition for the tool: no input parameters required.parameters: [],