Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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
  • 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
  • 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:
  • 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:
  • Auth registration mapping: 'get_usage' operation requires ApiKeyAuth scheme for Scrapingant API.
        "get_usage": [["ApiKeyAuth"]]
    }
  • Auth registration mapping: 'get_usage' operation requires APIKeyHeader scheme for AgentQL API.
        "get_usage": [["APIKeyHeader"]],
        "create_browser_session": [["APIKeyHeader"]],
        "list_session_usage": [["APIKeyHeader"]]
    }
Behavior3/5

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

No annotations provided, so description must stand alone. It states it retrieves data but omits whether it's read-only, rate limits, or response structure. Basic but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

Two short sentences, front-loaded with the action, no wasted words. Efficient and clear.

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?

No output schema, so description should detail return values; it does not specify what 'usage statistics' includes. Also missing idempotency and auth details beyond 'authenticated account'.

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?

No parameters exist, schema coverage is 100%. Baseline 3 per guidelines since schema covers all; description adds nothing beyond what schema already conveys.

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

Purpose5/5

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

The description clearly states it retrieves API key usage statistics and subscription details, with a specific verb and resource. The sibling tools (browser sessions, webpage data) are distinct, so no confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'useful for monitoring consumption limits and understanding remaining quota', giving clear context. Does not mention when not to use, but siblings are unrelated, so no conflict.

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/mcparmory/registry'

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