get_query_traffic_stats
Analyze query traffic statistics over time for a website using Bing Webmaster Tools data to monitor search performance trends.
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-1451 (registration)Registration of the 'get_query_traffic_stats' tool using the @mcp.tool decorator, specifying name and description.@mcp.tool( name="get_query_traffic_stats", description="Get traffic statistics for queries over time.", )
- mcp_server_bwt/main.py:1452-1473 (handler)The main handler function for the tool. It accepts site_url, query, and optional period parameters, makes an authenticated API request to Bing Webmaster Tools for query traffic stats, and returns the typed response.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:1453-1456 (schema)Input schema defined by Annotated type hints in the function signature, describing parameters for site URL, search query, and time period.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]: