Skip to main content
Glama
0xsl1m

cerebrus-pulse-mcp

cerebrus_spread

Analyze bid-ask spread, estimated slippage at various trade sizes, and liquidity score for Hyperliquid perpetuals. Returns metrics with a cost of $0.008 USDC via x402.

Instructions

Get spread and liquidity analysis for a Hyperliquid perpetual. Returns bid-ask spread, estimated slippage at $10k/$50k/$100k/$500k, and liquidity score (1-10). Cost: $0.008 USDC via x402.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesCoin ticker (e.g., BTC, ETH, SOL). Case-insensitive.

Implementation Reference

  • Tool 'cerebrus_spread' is registered as a Tool object in the list_tools() function with name, description, and inputSchema requiring a 'coin' string parameter.
    Tool(
        name="cerebrus_spread",
        description=(
            "Get spread and liquidity analysis for a Hyperliquid perpetual. "
            "Returns bid-ask spread, estimated slippage at $10k/$50k/$100k/$500k, "
            "and liquidity score (1-10). Cost: $0.008 USDC via x402."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "coin": {
                    "type": "string",
                    "description": "Coin ticker (e.g., BTC, ETH, SOL). Case-insensitive.",
                },
            },
            "required": ["coin"],
        },
    ),
  • Handler for cerebrus_spread: validates the coin parameter via _validate_coin() and calls the API endpoint /spread/{coin} via _api_get().
    elif name == "cerebrus_spread":
        coin = _validate_coin(arguments["coin"])
        result = _api_get(f"/spread/{coin}")
  • Helper function _validate_coin used by the handler to normalize and validate coin ticker input.
    def _validate_coin(coin: str) -> str:
        """Validate and normalize a coin ticker. Raises ValueError on bad input."""
        coin = coin.strip().upper()
        if not _COIN_RE.match(coin):
            raise ValueError(f"Invalid coin ticker: {coin!r}")
        return coin
  • Helper function _api_get used by the handler to make HTTP GET requests to the Cerebrus Pulse API, handling 402 (payment required) and 429 (rate limit) responses.
    def _api_get(path: str, params: dict | None = None) -> dict[str, Any]:
        """Make a GET request to the Cerebrus Pulse API."""
        with _make_client() as client:
            resp = client.get(path, params=params)
    
            if resp.status_code == 402:
                # Return payment details so the agent/user knows cost
                return {
                    "status": "payment_required",
                    "message": "This endpoint requires x402 USDC payment on Base or Solana.",
                    "url": f"{BASE_URL}{path}",
                    "payment_details": resp.headers.get("X-Payment", "See x402 SDK docs"),
                    "help": "Install the x402 SDK and set CEREBRUS_WALLET_KEY (Base) or CEREBRUS_WALLET_KEY_SOLANA (Solana) to enable auto-payment. See https://cerebruspulse.xyz/guides/x402-payments",
                }
    
            if resp.status_code == 429:
                return {
                    "status": "rate_limited",
                    "message": "Rate limit exceeded. Back off and retry.",
                    "detail": resp.json() if resp.headers.get("content-type", "").startswith("application/json") else resp.text,
                }
    
            resp.raise_for_status()
            return resp.json()
  • CLI tool mapping entry for 'spread' tool (maps to '/spread/{coin}' endpoint with required 'coin' param), used by the CLI mode (--json flag).
    "spread":        ("/spread/{coin}",     [("coin", True, str, None)]),
Behavior4/5

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

No annotations provided; description carries full burden. Clearly states cost $0.008 USDC and output structure. No destructive effects mentioned, appropriate for a read-only analytics tool. Sufficient but could mention rate limits or data freshness.

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?

Three sentences: purpose, output details, cost. No redundancy or filler. Every sentence provides actionable info for an AI agent.

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?

For a single-parameter tool with no output schema, description fully covers input, output, and cost. Agent can invoke correctly without additional context.

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?

Only one parameter 'coin' with full schema documentation. Description adds examples (BTC, ETH, SOL) and case-insensitivity, exceeding schema's 'Coin ticker.'. Value added beyond schema.

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?

Description clearly states 'Get spread and liquidity analysis for a Hyperliquid perpetual' with specific output fields (bid-ask spread, estimated slippage at $10k/$50k/$100k/$500k, liquidity score). Verb 'get' plus resource differentiate from sibling tools.

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

Usage Guidelines3/5

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

Implied usage: use when spread/liquidity data needed. No explicit when-not-to-use or comparison to siblings like cerebrus_basis or cerebrus_health. Could benefit from context on when this tool is preferred.

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/0xsl1m/cerebrus-pulse-mcp'

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