Skip to main content
Glama
isiahw1

mcp-server-bing-webmaster

get_query_stats

Retrieve detailed traffic statistics for top search queries from Bing Webmaster Tools to analyze website performance and optimize content.

Instructions

Get detailed traffic statistics for top queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_urlYes

Implementation Reference

  • Registers the 'get_query_stats' tool with the MCP server using the @mcp.tool decorator, specifying the name and description.
    @mcp.tool( name="get_query_stats", description="Get detailed traffic statistics for top queries.", )
  • The main handler function for the 'get_query_stats' tool. It accepts a site_url parameter, uses the BingWebmasterAPI to make a request to the 'GetQueryStats' endpoint, processes the response by adding the appropriate __type field for MCP compatibility, and returns a list of query statistics including clicks, impressions, CTR, and average position.
    async def get_query_stats( site_url: Annotated[str, "The URL of the site"] ) -> List[Dict[str, Any]]: """ Get detailed traffic statistics for top queries. Args: site_url: The URL of the site Returns: List of query statistics with clicks, impressions, CTR, and position """ async with api: stats = await api._make_request(f"GetQueryStats?siteUrl={site_url}") return api._ensure_type_field(stats, "QueryStats")

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