add_blocked_url
Block specific URLs or directories from Bing's web crawler to control site indexing and manage search engine visibility.
Instructions
Block a URL or directory from being crawled.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_url | Yes | ||
| url | Yes | ||
| block_type | No | Directory |
Implementation Reference
- mcp_server_bwt/main.py:523-545 (handler)The main handler function for the 'add_blocked_url' tool. It takes site_url, url, and optional block_type parameters, makes a POST request to the Bing API's 'AddBlockedUrl' endpoint, and returns a success message.async def add_blocked_url( site_url: Annotated[str, "The URL of the site"], url: Annotated[str, "The URL or directory to block"], block_type: Annotated[str, "Type of block (Page or Directory)"] = "Directory", ) -> Dict[str, str]: """ Block a URL or directory from being crawled. Args: site_url: The URL of the site url: The URL or directory to block block_type: Type of block ("Page" or "Directory") Returns: Success message """ async with api: await api._make_request( "AddBlockedUrl", "POST", {"siteUrl": site_url, "blockedUrl": url, "blockType": block_type}, ) return {"message": f"URL {url} blocked successfully"}
- mcp_server_bwt/main.py:520-522 (registration)Registers the 'add_blocked_url' tool with the MCP framework using the @mcp.tool decorator, defining its name and description.@mcp.tool( name="add_blocked_url", description="Block a URL or directory from being crawled." )
- mcp_server_bwt/main.py:524-526 (schema)Input schema defined using Annotated types with descriptions for parameters and return type.site_url: Annotated[str, "The URL of the site"], url: Annotated[str, "The URL or directory to block"], block_type: Annotated[str, "Type of block (Page or Directory)"] = "Directory",