Skip to main content
Glama
kvrancic

prime-intellect-mcp

by kvrancic

get_wallet_balance

Check your Prime Intellect wallet balance and recent billings to estimate how long a quoted pod can run or diagnose insufficient-funds errors.

Instructions

Return the current Prime Intellect wallet balance and recent billings.

Use this to estimate how long a quoted pod can run, or to check why pod_create returned an insufficient-funds error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual tool handler for get_wallet_balance. It is an async function decorated with @mcp.tool, calls clients.wallet.get(limit=5), and returns the wallet data as a dict.
    @mcp.tool
    async def get_wallet_balance() -> dict[str, Any]:
        """Return the current Prime Intellect wallet balance and recent billings.
    
        Use this to estimate how long a quoted pod can run, or to check why
        pod_create returned an insufficient-funds error.
        """
        clients = await get_clients()
        try:
            wallet = clients.wallet.get(limit=5)
        except Exception as e:
            raise _err(e) from e
        return wallet.model_dump()
  • The tool is registered via the @mcp.tool decorator on line 161, making it available as 'get_wallet_balance' on the FastMCP server.
    @mcp.tool
    async def get_wallet_balance() -> dict[str, Any]:
        """Return the current Prime Intellect wallet balance and recent billings.
    
        Use this to estimate how long a quoted pod can run, or to check why
        pod_create returned an insufficient-funds error.
        """
        clients = await get_clients()
        try:
            wallet = clients.wallet.get(limit=5)
        except Exception as e:
            raise _err(e) from e
        return wallet.model_dump()
  • The handler takes no parameters and returns dict[str, Any] — no Pydantic schema or Field is defined for inputs since this tool needs no arguments.
    @mcp.tool
    async def get_wallet_balance() -> dict[str, Any]:
        """Return the current Prime Intellect wallet balance and recent billings.
    
        Use this to estimate how long a quoted pod can run, or to check why
        pod_create returned an insufficient-funds error.
        """
        clients = await get_clients()
        try:
            wallet = clients.wallet.get(limit=5)
        except Exception as e:
            raise _err(e) from e
        return wallet.model_dump()
  • The wallet_balance_usd field on PodQuote model used by the tool for reporting balance information in quotes.
    wallet_balance_usd: float | None = Field(
        default=None,
        description="Current wallet balance in USD; None if not retrievable.",
    )
    estimated_runway_hours: float | None = Field(
        default=None,
        description="wallet_balance_usd / hourly_usd, if both known.",
    )
  • The check_caps function is used elsewhere in the server to validate wallet balance against spend caps.
    def check_caps(
        hourly_usd: float,
        max_lifetime_hours: int,
        wallet_balance_usd: float | None,
    ) -> None:
        """Raise SpendCapExceeded with a model-readable explanation if any cap is breached."""
    
        h_cap = max_hourly_usd()
        t_cap = max_total_usd()
        estimated_total = hourly_usd * max_lifetime_hours
    
        if hourly_usd > h_cap:
            raise SpendCapExceeded(
                f"Hourly rate ${hourly_usd:.2f}/hr exceeds PRIME_MAX_HOURLY_USD cap of "
                f"${h_cap:.2f}/hr. Either pick a cheaper GPU or raise the cap."
            )
        if estimated_total > t_cap:
            raise SpendCapExceeded(
                f"Estimated total ${estimated_total:.2f} (={hourly_usd:.2f} × "
                f"{max_lifetime_hours}h) exceeds PRIME_MAX_TOTAL_USD cap of "
                f"${t_cap:.2f}. Either lower max_lifetime_hours or raise the cap."
            )
        if wallet_balance_usd is not None and estimated_total > wallet_balance_usd:
            raise SpendCapExceeded(
                f"Estimated total ${estimated_total:.2f} exceeds wallet balance "
                f"${wallet_balance_usd:.2f}. Top up at primeintellect.ai/wallet "
                "or lower max_lifetime_hours."
            )
Behavior4/5

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

With no annotations provided, the description adequately discloses a read-only behavior and the return of balance and billings. There is no mention of side effects, rate limits, or auth requirements, but the tool is simple with no parameters and an output schema.

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 two sentences long with no wasted words. It front-loads the purpose immediately and follows with practical usage guidance.

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 the tool has no parameters, an output schema, and no annotations, the description fully covers its functionality, including both the return value and practical use cases.

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, and the input schema coverage is 100% (vacuously). The description does not need to add parameter information, so a baseline of 4 is appropriate.

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 'Return the current Prime Intellect wallet balance and recent billings,' identifying a specific verb and resource. It distinguishes itself from sibling tools like pod_create and pod_quote by focusing on wallet balance.

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 explicit use cases: estimating pod runtime and debugging insufficient-funds errors. It lacks an explicit when-not-to-use section, but the context is clear enough for a simple getter tool.

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/kvrancic/prime-intellect-mcp'

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