Skip to main content
Glama
0xsl1m

cerebrus-pulse-mcp

cerebrus_basis

Compare Hyperliquid perpetual oracle price vs Chainlink spot price on Arbitrum. Returns basis in bps, direction, and contrarian signal for a given coin.

Instructions

Get Chainlink basis analysis — compares Hyperliquid perpetual oracle price vs Chainlink aggregated spot price on Arbitrum. Returns basis in bps, direction (hl_premium/hl_discount/aligned), and contrarian signal. Positive = longs paying shorts, negative = deleveraging. Cost: $0.02 USDC via x402.

Input Schema

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

Implementation Reference

  • Tool schema definition for cerebrus_basis, registered in the list_tools() handler. Defines name, description, and input schema requiring a 'coin' string.
    Tool(
        name="cerebrus_basis",
        description=(
            "Get Chainlink basis analysis — compares Hyperliquid perpetual oracle price "
            "vs Chainlink aggregated spot price on Arbitrum. Returns basis in bps, "
            "direction (hl_premium/hl_discount/aligned), and contrarian signal. "
            "Positive = longs paying shorts, negative = deleveraging. Cost: $0.02 USDC via x402."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "coin": {
                    "type": "string",
                    "description": "Coin ticker (e.g., BTC, ETH, SOL). Case-insensitive.",
                },
            },
            "required": ["coin"],
        },
    ),
  • Handler logic for cerebrus_basis: validates the coin argument, then calls the API endpoint /basis/{coin} via the _api_get helper.
    elif name == "cerebrus_basis":
        coin = _validate_coin(arguments["coin"])
        result = _api_get(f"/basis/{coin}")
  • Helper function _api_get that makes HTTP GET requests to the Cerebrus Pulse API. Handles 402 (payment required), 429 (rate limit), and other HTTP errors.
    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()
  • Helper function _validate_coin that validates and normalizes coin ticker input (strips whitespace, uppercases, checks regex).
    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
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the cost ($0.02 USDC via x402) and interprets output signals. It does not mention rate limits or auth needs, but the read-only analytic nature is clear. No contradictions.

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: first defines purpose, second describes returns, third states cost. Every sentence adds value, front-loaded, no redundancy.

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

Completeness4/5

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

For a simple one-parameter tool, the description covers purpose, output, and cost. It lacks error behavior details but is sufficient for typical use. Sibling links provide additional context.

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?

Schema coverage is 100% with a single 'coin' parameter described. The description does not add additional semantics beyond the schema, but it provides context on how the parameter is used in the analysis. Baseline 3 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 explicitly states the tool retrieves Chainlink basis analysis comparing Hyperliquid perpetual oracle price vs Chainlink aggregated spot price on Arbitrum. It lists output fields (basis in bps, direction, contrarian signal) and cost, clearly distinguishing its purpose from siblings like cerebrus_funding or cerebrus_spread.

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?

The description provides context for when basis analysis is relevant (e.g., positive basis means longs pay shorts), but it does not explicitly state when to use this tool instead of alternatives like cerebrus_funding or cerebrus_sentiment. Usage is implied but not delineated.

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