wp_site_info
Retrieve WordPress site details including name, description, URL, timezone, and GMT offset to understand site configuration and settings.
Instructions
Get WordPress site information.
Returns:
Site info including name, description, url, home, gmt_offset, and timezone.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/wordpress_mcp/server.py:94-102 (handler)Handler function for the wp_site_info tool. Retrieves the shared WordPressClient instance and delegates to its get_site_info() method. The @mcp.tool() decorator registers the tool with the MCP server and infers schema from signature/docstring.@mcp.tool() def wp_site_info() -> dict: """Get WordPress site information. Returns: Site info including name, description, url, home, gmt_offset, and timezone. """ client = get_client() return client.get_site_info()
- src/wordpress_mcp/client.py:165-182 (helper)Core helper method in WordPressClient that implements the site information retrieval by querying the WordPress REST API root endpoint (/wp-json), parsing the response, and returning a formatted dictionary with site details.def get_site_info(self) -> dict: """Get site information.""" # Use the root endpoint for site info url = f"{self.config.url.rstrip('/')}/wp-json" headers = self._get_headers() response = self._client.get(url, headers=headers) response.raise_for_status() data = response.json() return { "name": data.get("name", ""), "description": data.get("description", ""), "url": data.get("url", ""), "home": data.get("home", ""), "gmt_offset": data.get("gmt_offset", 0), "timezone_string": data.get("timezone_string", ""), }