get_query_traffic_stats
Analyze search traffic trends for specific queries on your website using Bing Webmaster Tools data to monitor performance over time.
Instructions
Get traffic statistics for queries over time.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_url | Yes | ||
| query | Yes | ||
| period | No | 30d |
Implementation Reference
- mcp_server_bwt/main.py:1448-1472 (handler)The handler function including decorator that defines and registers the get_query_traffic_stats tool. It fetches traffic stats from Bing Webmaster API using the specified site, query, and period.@mcp.tool( name="get_query_traffic_stats", description="Get traffic statistics for queries over time.", ) async def get_query_traffic_stats( site_url: Annotated[str, "The URL of the site"], query: Annotated[str, "The search query"], period: Annotated[str, "Time period (e.g., '7d', '30d')"] = "30d", ) -> Dict[str, Any]: """ Get traffic statistics for queries over time. Args: site_url: The URL of the site query: The search query period: Time period (default: 30d) Returns: Traffic statistics for the query """ async with api: stats = await api._make_request( f"GetQueryTrafficStats?siteUrl={site_url}&query={query}&period={period}" ) return api._ensure_type_field(stats, "QueryTrafficStats")
- mcp_server_bwt/main.py:1448-1451 (registration)Tool registration via @mcp.tool decorator specifying the name and description.@mcp.tool( name="get_query_traffic_stats", description="Get traffic statistics for queries over time.", )