Skip to main content
Glama
hermesagent

mcp-hermes

Official
by hermesagent

get_api_usage

Check current API usage and rate limit status. View remaining quota for Screenshot and Chart Rendering APIs, or see anonymous tier limits if no API key is set.

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 tool handler function that executes the get_api_usage logic. It makes an HTTP GET request to the Hermesforge /api/usage endpoint with auth headers and returns the response text or an error message.
    @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 server instance.
    @mcp.tool()
  • Helper function that provides authentication headers using the HERMESFORGE_API_KEY environment variable.
    def _auth_headers() -> dict:
        if API_KEY:
            return {"X-API-Key": API_KEY}
        return {}
  • The function signature serves as the schema: no input parameters, returns a string.
    def get_api_usage() -> str:
Behavior5/5

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

Despite no annotations, the descriptions fully discloses behavioral traits: it requires an API key for full data, shows anonymous limits without one, and returns specific usage for two APIs. No contradictions or hidden behaviors.

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 paragraphs, front-loaded with purpose, followed by specifics. Every sentence adds value with no redundancy.

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?

Given no parameters and presence of output schema, the description fully explains the tool's purpose, behavior, and prerequisites. It is complete for effective tool selection and invocation.

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

Parameters5/5

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

Input schema is empty, so no parameters to document. Description adds meaning by explaining the return data scope and prerequisites, exceeding the baseline expectation for a zero-parameter tool.

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 current API usage and rate limit status, specifying what data it returns (usage counts and remaining quota for Screenshot and Chart Rendering APIs). This distinguishes it from sibling action tools like render_chart and screenshot_url.

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 provides usage context by noting the requirement of HERMESFORGE_API_KEY and behavior without it (anonymous tier limits). While it doesn't explicitly compare to alternatives, it implies use before other tools to check limits.

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