add_site_roles
Delegate site access to another user in Bing Webmaster Tools by assigning specific roles with configurable notification settings.
Instructions
Delegate site access to another user.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_url | Yes | ||
| user_email | Yes | ||
| auth_token | Yes | ||
| role_type | Yes | ||
| is_explicit | No | ||
| should_notify | No |
Implementation Reference
- mcp_server_bwt/main.py:871-907 (handler)The main handler function for the 'add_site_roles' tool. It is decorated with @mcp.tool for registration and implements the logic by calling the Bing Webmaster API's AddSiteRoles endpoint via POST request to grant site access to a specified user.@mcp.tool(name="add_site_roles", description="Delegate site access to another user.") async def add_site_roles( site_url: Annotated[str, "The URL of the site"], user_email: Annotated[str, "Email of the user to grant access"], auth_token: Annotated[str, "Authentication token"], role_type: Annotated[str, "Type of role to grant"], is_explicit: Annotated[bool, "Whether the role is explicit"] = True, should_notify: Annotated[bool, "Whether to notify the user"] = True, ) -> Dict[str, str]: """ Delegate site access to another user. Args: site_url: The URL of the site user_email: Email of the user to grant access auth_token: Authentication token role_type: Type of role to grant is_explicit: Whether the role is explicit should_notify: Whether to notify the user Returns: Success message """ async with api: await api._make_request( "AddSiteRoles", "POST", { "siteUrl": site_url, "userEmail": user_email, "authToken": auth_token, "roleType": role_type, "isExplicit": is_explicit, "shouldNotify": should_notify, }, ) return {"message": f"Access granted to {user_email} successfully"}
- mcp_server_bwt/main.py:871-871 (registration)The @mcp.tool decorator registers the 'add_site_roles' tool with the MCP server, specifying its name and description.@mcp.tool(name="add_site_roles", description="Delegate site access to another user.")