Skip to main content
Glama
hermesagent

mcp-hermes

Official
by hermesagent

get_api_usage

Check your current API usage and rate limit status for Screenshot and Chart Rendering APIs. View remaining quota to stay within limits.

Instructions

Check your current API usage and rate limit status.

Returns your current usage counts and remaining quota for:

  • Screenshot API

  • Chart Rendering API

Requires HERMESFORGE_API_KEY environment variable to be set. Without an API key, shows anonymous tier limits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_api_usage' tool. It calls the Hermesforge /api/usage endpoint with auth headers and returns the raw response text showing current API usage and rate limit status.
    @mcp.tool()
    def get_api_usage() -> str:
        """
        Check your current API usage and rate limit status.
    
        Returns your current usage counts and remaining quota for:
        - Screenshot API
        - Chart Rendering API
    
        Requires HERMESFORGE_API_KEY environment variable to be set.
        Without an API key, shows anonymous tier limits.
        """
        try:
            resp = requests.get(
                f"{API_BASE}/api/usage",
                headers=_auth_headers(),
                timeout=10,
            )
        except requests.RequestException as e:
            return f"Error: Could not reach Hermesforge API: {e}"
    
        if resp.status_code == 200:
            return resp.text
        else:
            return f"Error: {resp.status_code}: {resp.text[:200]}"
  • The @mcp.tool() decorator registers get_api_usage as an MCP tool on the FastMCP 'Hermesforge' server instance.
    @mcp.tool()
    def get_api_usage() -> str:
  • Helper function that returns the authentication headers dictionary, conditionally including the X-API-Key header if HERMESFORGE_API_KEY is set.
    def _auth_headers() -> dict:
        if API_KEY:
            return {"X-API-Key": API_KEY}
        return {}
  • The get_api_usage tool has no input parameters (zero arguments) and returns a string. No explicit schema beyond the function signature is needed.
    @mcp.tool()
    def get_api_usage() -> str:
        """
        Check your current API usage and rate limit status.
    
        Returns your current usage counts and remaining quota for:
        - Screenshot API
        - Chart Rendering API
    
        Requires HERMESFORGE_API_KEY environment variable to be set.
        Without an API key, shows anonymous tier limits.
        """
        try:
            resp = requests.get(
                f"{API_BASE}/api/usage",
                headers=_auth_headers(),
                timeout=10,
            )
        except requests.RequestException as e:
            return f"Error: Could not reach Hermesforge API: {e}"
    
        if resp.status_code == 200:
            return resp.text
        else:
            return f"Error: {resp.status_code}: {resp.text[:200]}"
Behavior4/5

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

No annotations are provided, so the description carries full burden. It describes what the tool returns (usage counts, remaining quota) and the environment variable requirement, including anonymous tier behavior. Some additional details like rate limit reset times could improve transparency.

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?

The description is very short and front-loaded, using bullet points for clarity. Every sentence is necessary and provides value with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with no parameters and has an output schema (not shown but present). The description covers the return values and prerequisites comprehensively, making it fully complete for an agent to invoke.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the baseline is 4. The description adds no parameter information because none is needed.

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 the tool checks API usage and rate limit status, listing specific APIs (Screenshot, Chart Rendering). It distinguishes itself from sibling tools like render_chart and screenshot_url, which perform different functions.

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?

The description mentions the prerequisite of HERMESFORGE_API_KEY and fallback behavior without it, providing clear context for usage. It doesn't explicitly state when to use this tool, but the use case is self-evident.

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/hermesagent/hermesforge-mcp'

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