Skip to main content
Glama

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
NameRequiredDescriptionDefault
siteNoThe ID of the WordPress site to target (from mcp-wordpress.config.json). Required if multiple sites are configured.

Implementation Reference

  • 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)}`);
      }
    }
  • 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),
    },
  • Schema definition for the tool: no input parameters required.
    parameters: [],

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/docdyhr/mcp-wordpress'

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