get_usage
Monitor API key usage statistics and subscription details to track consumption limits and remaining quota.
Instructions
Retrieves current API key usage statistics and subscription details for the authenticated account. Useful for monitoring consumption limits and understanding remaining quota.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- servers/scrapingant/server.py:1446-1470 (handler)The 'get_usage' tool handler function for the Scrapingant API MCP server. Makes a GET request to /v2/usage to retrieve API credits usage status and consumption metrics.
@mcp.tool() async def get_usage() -> dict[str, Any] | ToolResult: """Retrieve the current API credits usage status and consumption metrics for your Scrapingant account.""" # Extract parameters for API call _http_path = "/v2/usage" _http_query = {} # Inject per-operation authentication _auth = await _get_auth_for_operation("get_usage") _http_query.update(_auth.get("params", {})) _request_id = str(uuid.uuid4()) _log_tool_invocation("get_usage", "GET", _http_path, _request_id) # Execute request (returns normalized dict and status code) _response_data, _ = await _execute_tool_request( tool_name="get_usage", method="GET", path=_http_path, request_id=_request_id, params=_http_query, ) return _response_data - servers/agentql/server.py:1268-1292 (handler)The 'get_usage' tool handler function for the AgentQL MCP server. Makes a GET request to /v1/usage to retrieve API key usage statistics and subscription details.
@mcp.tool() async def get_usage() -> dict[str, Any] | ToolResult: """Retrieves current API key usage statistics and subscription details for the authenticated account. Useful for monitoring consumption limits and understanding remaining quota.""" # Extract parameters for API call _http_path = "/v1/usage" _http_headers = {} # Inject per-operation authentication _auth = await _get_auth_for_operation("get_usage") _http_headers.update(_auth.get("headers", {})) _request_id = str(uuid.uuid4()) _log_tool_invocation("get_usage", "GET", _http_path, _request_id) # Execute request (returns normalized dict and status code) _response_data, _ = await _execute_tool_request( tool_name="get_usage", method="GET", path=_http_path, request_id=_request_id, headers=_http_headers, ) return _response_data - servers/scrapingant/server.py:1446-1447 (registration)Registration via @mcp.tool() decorator on the get_usage async function in the Scrapingant API server.
@mcp.tool() async def get_usage() -> dict[str, Any] | ToolResult: - servers/agentql/server.py:1268-1269 (registration)Registration via @mcp.tool() decorator on the get_usage async function in the AgentQL server.
@mcp.tool() async def get_usage() -> dict[str, Any] | ToolResult: - servers/scrapingant/_auth.py:115-116 (helper)Auth registration mapping: 'get_usage' operation requires ApiKeyAuth scheme for Scrapingant API.
"get_usage": [["ApiKeyAuth"]] } - servers/agentql/_auth.py:111-114 (helper)Auth registration mapping: 'get_usage' operation requires APIKeyHeader scheme for AgentQL API.
"get_usage": [["APIKeyHeader"]], "create_browser_session": [["APIKeyHeader"]], "list_session_usage": [["APIKeyHeader"]] }