get_crawl_stats
Retrieve crawl statistics for a specific website from Bing Webmaster Tools to monitor search engine indexing performance.
Instructions
Retrieve crawl statistics for a specific site.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_url | Yes |
Implementation Reference
- mcp_server_bwt/main.py:260-262 (registration)The @mcp.tool decorator registers the get_crawl_stats tool with MCP, providing name and description. The function signature below defines the input/output schema.@mcp.tool( name="get_crawl_stats", description="Retrieve crawl statistics for a specific site." )
- mcp_server_bwt/main.py:263-265 (schema)The function signature provides the input schema (site_url: Annotated[str, ...]) and output type (List[Dict[str, Any]]), used by MCP for tool schema validation.async def get_crawl_stats( site_url: Annotated[str, "The URL of the site"] ) -> List[Dict[str, Any]]:
- mcp_server_bwt/main.py:263-278 (handler)The main handler function that implements the tool logic: acquires an API context, makes a request to Bing's GetCrawlStats endpoint with the site_url, ensures the response has the correct type field, and returns the statistics.async def get_crawl_stats( site_url: Annotated[str, "The URL of the site"] ) -> List[Dict[str, Any]]: """ Retrieve crawl statistics for a specific site. Args: site_url: The URL of the site Returns: List of daily crawl statistics """ async with api: stats = await api._make_request(f"GetCrawlStats?siteUrl={site_url}") return api._ensure_type_field(stats, "CrawlStats")