get_keyword_stats
Retrieve historical keyword performance data from Bing Webmaster Tools to analyze search trends and optimize SEO strategies.
Instructions
Get historical statistics for a specific keyword.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_url | Yes | ||
| query | Yes | ||
| country | No | ||
| language | No |
Implementation Reference
- mcp_server_bwt/main.py:691-722 (handler)The complete tool handler for get_keyword_stats, including decorator for registration and schema via type annotations, and the execution logic that constructs parameters and calls the Bing API endpoint GetKeywordStats.@mcp.tool( name="get_keyword_stats", description="Get historical statistics for a specific keyword.", ) async def get_keyword_stats( site_url: Annotated[str, "The URL of the site"], query: Annotated[str, "The keyword/query to analyze"], country: Annotated[str, "Country code (e.g., 'US', 'GB')"] = "", language: Annotated[str, "Language code (e.g., 'en', 'fr')"] = "", ) -> Dict[str, Any]: """ Get historical statistics for a specific keyword. Args: site_url: The URL of the site query: The keyword/query to analyze country: Country code (optional) language: Language code (optional) Returns: Historical keyword statistics """ async with api: params = f"siteUrl={site_url}&query={query}" if country: params += f"&country={country}" if language: params += f"&language={language}" stats = await api._make_request(f"GetKeywordStats?{params}") return api._ensure_type_field(stats, "KeywordStats")