Skip to main content
Glama
isiahw1

mcp-server-bing-webmaster

get_url_submission_quota

Check Bing Webmaster Tools URL submission quota and usage for a website to manage indexing limits.

Instructions

Get information about URL submission quota and usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_urlYes

Implementation Reference

  • Registration of the 'get_url_submission_quota' tool using the @mcp.tool decorator.
    @mcp.tool( name="get_url_submission_quota", description="Get information about URL submission quota and usage.", )
  • The main handler function that executes the tool logic by making an API request to Bing Webmaster Tools for the URL submission quota and processing the response.
    async def get_url_submission_quota( site_url: Annotated[str, "The URL of the site"] ) -> Dict[str, Any]: """ Get information about URL submission quota and usage. Args: site_url: The URL of the site Returns: Quota information """ async with api: quota = await api._make_request(f"GetUrlSubmissionQuota?siteUrl={site_url}") return api._ensure_type_field(quota, "UrlSubmissionQuota")
  • Helper method used in the handler to ensure the response has the required __type field for MCP 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
  • Core helper method in BingWebmasterAPI class that makes HTTP requests to the Bing Webmaster API, handles responses, and is called by the tool handler.
    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

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