Skip to main content
Glama
isiahw1

mcp-server-bing-webmaster

get_url_info

Retrieve detailed index information for specific URLs to monitor search engine visibility and performance.

Instructions

Get detailed index information for a specific URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_urlYes
urlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the get_url_info tool logic. It takes site_url and url parameters, calls the Bing Webmaster API's GetUrlInfo endpoint via _make_request, adds MCP-compatible __type field, and returns the info.
    async def get_url_info(
        site_url: Annotated[str, "The URL of the site"],
        url: Annotated[str, "The specific URL to check"],
    ) -> Dict[str, Any]:
        """
        Get detailed index information for a specific URL.
    
        Args:
            site_url: The URL of the site
            url: The specific URL to check
    
        Returns:
            Detailed information about the URL's index status
        """
        async with api:
            info = await api._make_request(f"GetUrlInfo?siteUrl={site_url}&url={url}")
            return api._ensure_type_field(info, "UrlInfo")
  • Registration of the get_url_info tool with FastMCP using the @mcp.tool decorator. The input schema is automatically generated from the Annotated type hints in the handler function signature.
    @mcp.tool(
        name="get_url_info",
        description="Get detailed index information for a specific URL.",
    )
  • Helper method in BingWebmasterAPI class to add __type fields to API responses for MCP compatibility, specifically called in get_url_info with 'UrlInfo'.
    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 in BingWebmasterAPI class that performs HTTP requests to the Bing Webmaster API, handles OData responses, and is used by get_url_info to call the GetUrlInfo endpoint.
    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 the full burden of behavioral disclosure. It states the tool retrieves 'detailed index information' but doesn't specify what that includes (e.g., crawl status, indexing dates, canonicalization). It also omits critical details like whether this is a read-only operation, potential rate limits, authentication requirements, or error conditions. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 function without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly. There's no wasted verbiage or redundant information.

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 that an output schema exists, the description doesn't need to explain return values. However, for a tool with no annotations, 0% parameter schema coverage, and multiple similar siblings, the description is incomplete—it lacks behavioral context, parameter guidance, and usage distinctions. It meets a minimal baseline by stating the purpose but falls short of providing a comprehensive understanding for effective tool selection and invocation.

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

Parameters2/5

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

The input schema has 0% description coverage, with two required parameters ('site_url' and 'url') that are undocumented. The description adds no semantic information about these parameters—it doesn't explain what 'site_url' versus 'url' represent, their expected formats, or examples. With low schema coverage, the description fails to compensate, leaving parameters ambiguous.

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 ('Get detailed index information') and resource ('for a specific URL'), making the purpose understandable. It distinguishes itself from siblings like 'get_url_traffic_info' by focusing on 'index information' rather than traffic data. However, it doesn't explicitly differentiate from 'fetch_url' or 'get_fetched_url_details', which might have overlapping functions.

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 siblings like 'fetch_url', 'get_fetched_url_details', and 'get_url_traffic_info', there's no indication of which tool is appropriate for different scenarios (e.g., real-time fetching vs. historical index data). The description lacks any context about prerequisites or exclusions.

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