Skip to main content
Glama
isiahw1

mcp-server-bing-webmaster

get_sites

Retrieve all websites from your Bing Webmaster Tools account to manage and monitor site performance.

Instructions

Retrieve all sites in the user's Bing Webmaster Tools account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The get_sites tool handler: decorated function that retrieves all sites from the Bing Webmaster Tools API using GetUserSites endpoint, processes the response with type fields, and returns a list of site dictionaries.
    @mcp.tool(
        name="get_sites",
        description="Retrieve all sites in the user's Bing Webmaster Tools account",
    )
    async def get_sites() -> List[Dict[str, Any]]:
        """
        Retrieve all sites in the user's Bing Webmaster Tools account.
    
        Returns:
            List of sites with their details including URL, verification status, etc.
        """
        async with api:
            sites = await api._make_request("GetUserSites")
            return api._ensure_type_field(sites, "Site")
  • Registration of the get_sites tool via @mcp.tool decorator specifying name and description.
    @mcp.tool(
        name="get_sites",
        description="Retrieve all sites in the user's Bing Webmaster Tools account",
    )
  • Helper method _ensure_type_field used by get_sites to add MCP-compatible __type fields to the API response data.
    def _ensure_type_field(self, data: Any, type_name: str) -> Any:
        """Ensure __type field is present for MCP compatibility."""
        if isinstance(data, list):
            for item in data:
                if isinstance(item, dict) and "__type" not in item:
                    item["__type"] = f"{type_name}:#Microsoft.Bing.Webmaster.Api"
        elif isinstance(data, dict) and "__type" not in data:
            data["__type"] = f"{type_name}:#Microsoft.Bing.Webmaster.Api"
        return data
  • Core helper method _make_request used by get_sites to perform the HTTP request to the Bing Webmaster API, handle OData responses, and manage errors.
    async def _make_request(
        self,
        endpoint: str,
        method: str = "GET",
        json_data: Optional[Dict[str, Any]] = None,
        params: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Make a request to the Bing API and handle OData responses."""
        if not self.client:
            raise RuntimeError(
                "API client not initialized. Use 'async with api:' context manager."
            )
    
        headers = {"Content-Type": "application/json; charset=utf-8"}
    
        # Build URL with API key
        if "?" in endpoint:
            url = f"{self.base_url}/{endpoint}&apikey={self.api_key}"
        else:
            url = f"{self.base_url}/{endpoint}?apikey={self.api_key}"
    
        # Add additional parameters if provided
        if params:
            for key, value in params.items():
                url += f"&{key}={value}"
    
        try:
            if method == "GET":
                response = await self.client.get(url, headers=headers)
            else:
                response = await self.client.request(
                    method, url, headers=headers, json=json_data
                )
    
            if response.status_code != 200:
                error_text = response.text
                logger.error(f"API error {response.status_code}: {error_text}")
                raise Exception(f"API error {response.status_code}: {error_text}")
    
            data = response.json()
    
            # Handle OData response format
            if "d" in data:
                return data["d"]
            return data
    
        except httpx.TimeoutException:
            logger.error(f"Request timeout for {endpoint}")
            raise Exception("Request timed out")
        except Exception as e:
            logger.error(f"Request failed: {str(e)}")
            raise
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states this is a retrieval operation but doesn't disclose behavioral traits like whether it requires authentication, returns paginated results, includes rate limits, or what format the output takes. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every word earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has zero parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, as a read operation with no annotations, it should ideally mention output format or behavioral context. The existence of an output schema reduces the need to describe returns, but the description could be more informative about usage context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (empty schema is fully described). The description doesn't need to explain parameters, and it correctly doesn't mention any. Baseline for zero parameters is 4, as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieve') and resource ('all sites in the user's Bing Webmaster Tools account'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_site_roles' or 'get_site_moves', which also retrieve site-related information but with different scopes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools that retrieve specific site data (e.g., 'get_site_roles', 'get_site_moves', 'get_crawl_stats'), there's no indication whether this is a general overview tool or how it relates to more specific queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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