Skip to main content
Glama
zizzfizzix

Bing Webmaster Tools MCP Server

by zizzfizzix

add_deep_link_block

Block specific deep links from appearing in Bing search results for a website by specifying the site URL, market, and target URLs.

Instructions

Add a deep link block.

Args: site_url: The URL of the site market: The market code search_url: The search URL deep_link_url: The deep link URL to block

Raises: BingWebmasterError: If block cannot be added

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selfYes
site_urlYes
marketYes
search_urlYes
deep_link_urlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registers the 'add_deep_link_block' MCP tool by wrapping the 'add_deep_link_block' method from the 'links' service (link_analysis.LinkAnalysisService). The wrapper is decorated with @mcp.tool() and preserves the original method's signature and docstring.
    add_deep_link_block = wrap_service_method(  # noqa: F841
        mcp, service, "links", "add_deep_link_block"
    )
  • The core handler logic executed by the tool. It acquires the BingWebmasterService context, retrieves the 'links' sub-service instance, binds the 'add_deep_link_block' method, and invokes it with the provided arguments. This is the dynamically generated function for the tool.
    @mcp.tool()
    @wraps(original_method)
    async def wrapper(*args: Any, **kwargs: Any) -> Any:
        # Filter out any 'self' arguments that might be passed by the MCP client
        kwargs = {k: v for k, v in kwargs.items() if k != "self"}
    
        async with service as s:
            service_obj = getattr(s, service_attr)
            # Get the method from the instance
            method = getattr(service_obj, method_name)
            # Call the method directly - it's already bound to the instance
            return await method(*args, **kwargs)
    
    # Copy signature and docstring
    wrapper.__signature__ = new_sig  # type: ignore
    wrapper.__doc__ = original_method.__doc__
  • Helper function that generates the MCP tool handler for service methods, including signature preservation and docstring copying from the original service method.
    def wrap_service_method(
        mcp: FastMCP, service: BingWebmasterService, service_attr: str, method_name: str
    ) -> Callable[..., Any]:
        """Helper function to wrap a service method with mcp.tool() while preserving its signature and docstring.
    
        Args:
            mcp: The MCP server instance
            service: The BingWebmasterService instance
            service_attr: The service attribute name (e.g., 'sites', 'submission')
            method_name: The method name to wrap
    
        Returns:
            The wrapped method as an MCP tool
        """
        # Get the service class from our mapping
        service_class = SERVICE_CLASSES[service_attr]
        # Get the original method
        original_method = getattr(service_class, method_name)
        # Get the signature
        sig = inspect.signature(original_method)
        # Remove 'self' parameter from signature
        parameters = list(sig.parameters.values())[1:]  # Skip 'self'
    
        # Create new signature without 'self'
        new_sig = sig.replace(parameters=parameters)
    
        # Create wrapper function with same signature
        @mcp.tool()
        @wraps(original_method)
        async def wrapper(*args: Any, **kwargs: Any) -> Any:
            # Filter out any 'self' arguments that might be passed by the MCP client
            kwargs = {k: v for k, v in kwargs.items() if k != "self"}
    
            async with service as s:
                service_obj = getattr(s, service_attr)
                # Get the method from the instance
                method = getattr(service_obj, method_name)
                # Call the method directly - it's already bound to the instance
                return await method(*args, **kwargs)
    
        # Copy signature and docstring
        wrapper.__signature__ = new_sig  # type: ignore
        wrapper.__doc__ = original_method.__doc__
    
        return wrapper
  • In the __aenter__ of BingWebmasterService, initializes and exposes the 'links' sub-service instance (link_analysis.LinkAnalysisService) which provides the 'add_deep_link_block' method delegated to by the tool handler.
    # Expose all services directly
    self.sites = site_management.SiteManagementService(self.client)
    self.submission = submission.SubmissionService(self.client)
    self.traffic = traffic_analysis.TrafficAnalysisService(self.client)
    self.crawling = crawling.CrawlingService(self.client)
    self.keywords = keyword_analysis.KeywordAnalysisService(self.client)
    self.links = link_analysis.LinkAnalysisService(self.client)
    self.content = content_management.ContentManagementService(self.client)
    self.blocking = content_blocking.ContentBlockingService(self.client)
    self.regional = regional_settings.RegionalSettingsService(self.client)
    self.urls = url_management.UrlManagementService(self.client)
    return self
  • Invokes the function that registers all Bing Webmaster tools, including 'add_deep_link_block', to the MCP server.
    add_bing_webmaster_tools(mcp, bing_service)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions that the operation can fail with 'BingWebmasterError', which is useful, but doesn't describe what 'adding a block' actually does behaviorally - whether it's a permanent configuration change, requires specific permissions, affects SEO/crawling, or has rate limits. The mutation nature ('Add') is clear but 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.

Conciseness4/5

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

The description is efficiently structured with a purpose statement followed by Args and Raises sections. Every sentence serves a purpose - stating the action, listing parameters, and documenting error conditions. However, the initial purpose statement could be more informative to better front-load the tool's value.

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 5 parameters with 0% schema coverage and no annotations, the description provides basic parameter listing and error documentation. The presence of an output schema means return values don't need explanation. However, for a mutation tool in a complex webmaster API with many sibling tools, the description lacks context about how this fits into the broader workflow and what the operational implications are.

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?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description lists all 5 parameters with brief labels, adding basic semantic meaning beyond the schema's property names. However, it doesn't explain what each parameter represents (e.g., what 'market code' format, what constitutes a valid 'deep link URL'), leaving significant gaps in understanding parameter usage.

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

Purpose3/5

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

The description states 'Add a deep link block' which is a clear verb+resource combination, but it's vague about what a 'deep link block' actually is and doesn't differentiate from sibling tools like 'add_blocked_url' or 'remove_deep_link_block'. The purpose is understandable but lacks specificity about the domain context.

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?

No guidance is provided about when to use this tool versus alternatives like 'add_blocked_url' or 'remove_deep_link_block'. The description doesn't mention prerequisites, context, or relationships to other tools in the Bing Webmaster ecosystem, leaving the agent with no usage context.

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/zizzfizzix/mcp-server-bwt'

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