Skip to main content
Glama
isiahw1

mcp-server-bing-webmaster

get_keyword_stats

Retrieve historical keyword performance data from Bing Webmaster Tools to analyze search trends and optimize website content.

Instructions

Get historical statistics for a specific keyword.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_urlYes
queryYes
countryNo
languageNo

Implementation Reference

  • The complete handler and registration for the 'get_keyword_stats' tool. It constructs parameters and makes an API request to Bing Webmaster Tools' GetKeywordStats endpoint, then ensures MCP type compatibility.
    @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")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/isiahw1/mcp-server-bing-webmaster'

If you have feedback or need assistance with the MCP directory API, please join our Discord server