get_page_stats
Retrieve traffic statistics for top-performing pages from Bing Webmaster Tools to analyze site performance and identify high-traffic content.
Instructions
Get traffic statistics for top pages.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_url | Yes |
Implementation Reference
- mcp_server_bwt/main.py:220-236 (handler)The handler function for the 'get_page_stats' tool. It takes a site_url parameter, makes an API request to Bing Webmaster Tools for page statistics, ensures type fields for MCP compatibility, and returns the list of page stats.@mcp.tool(name="get_page_stats", description="Get traffic statistics for top pages.") async def get_page_stats( site_url: Annotated[str, "The URL of the site"] ) -> List[Dict[str, Any]]: """ Get traffic statistics for top pages. Args: site_url: The URL of the site Returns: List of page statistics """ async with api: stats = await api._make_request(f"GetPageStats?siteUrl={site_url}") return api._ensure_type_field(stats, "PageStats")
- mcp_server_bwt/main.py:220-220 (registration)The @mcp.tool decorator registers the get_page_stats function as an MCP tool with the specified name and description.@mcp.tool(name="get_page_stats", description="Get traffic statistics for top pages.")