Skip to main content
Glama
isiahw1

mcp-server-bing-webmaster

get_blocked_urls

Retrieve blocked URLs for a website to identify and resolve indexing issues in Bing Webmaster Tools.

Instructions

Get list of blocked URLs for a site.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_urlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function for the 'get_blocked_urls' tool. Registered via @mcp.tool decorator. Takes site_url as input, calls Bing Webmaster API's GetBlockedUrls endpoint via the api helper, and returns list of blocked URLs with MCP-compatible typing.
    @mcp.tool(name="get_blocked_urls", description="Get list of blocked URLs for a site.")
    async def get_blocked_urls(
        site_url: Annotated[str, "The URL of the site"]
    ) -> List[Dict[str, Any]]:
        """
        Get list of blocked URLs for a site.
    
        Args:
            site_url: The URL of the site
    
        Returns:
            List of blocked URLs
        """
        async with api:
            urls = await api._make_request(f"GetBlockedUrls?siteUrl={site_url}")
            return api._ensure_type_field(urls, "BlockedUrl")
  • Core helper method in BingWebmasterAPI class that performs the actual HTTP request to Bing Webmaster API, handles authentication, parameters, errors, and OData response unwrapping. Used by get_blocked_urls.
    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
  • Helper method that adds MCP-required __type fields to API response data for compatibility.
    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
  • The @mcp.tool decorator registers the get_blocked_urls function as an MCP tool with the specified name and description.
    @mcp.tool(name="get_blocked_urls", description="Get list of blocked URLs for a site.")
  • Global instantiation of the BingWebmasterAPI client used by all tools including get_blocked_urls.
    api = BingWebmasterAPI(API_KEY)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but fails to describe key traits: whether this requires specific permissions, if it returns paginated results, what the output format is, or any rate limits. The description is minimal and doesn't compensate for the lack of annotations.

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 with zero waste—it directly states the tool's purpose without unnecessary words. It is appropriately sized for a simple retrieval tool and front-loaded with the core action.

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's low complexity (1 parameter) and the presence of an output schema, the description is minimally adequate. However, with no annotations and incomplete parameter guidance, it lacks context on permissions, behavior, and usage scenarios. The output schema may cover return values, but the description doesn't provide enough operational context for safe and effective use.

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

Parameters3/5

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

The input schema has 1 parameter with 0% description coverage, so the schema provides no semantic context. The description mentions 'for a site', which implies the 'site_url' parameter is required, adding some meaning beyond the schema. However, it doesn't specify the format or constraints for 'site_url', leaving gaps in parameter understanding.

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 verb 'Get' and resource 'list of blocked URLs for a site', which is specific and unambiguous. It distinguishes from siblings like 'add_blocked_url' and 'remove_blocked_url' by focusing on retrieval rather than modification. However, it doesn't explicitly mention that it's a read-only operation, which would make it fully distinct.

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 like 'get_fetched_urls' or 'get_url_info', nor does it mention prerequisites such as site verification or authentication requirements. It lacks explicit context for usage, leaving the agent to infer based on the tool name alone.

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