Skip to main content
Glama
pythia-the-oracle

pythia-oracle-mcp

Official

get_contracts

Retrieve contract addresses for integrating on-chain crypto indicators via Pythia oracles on all supported chains.

Instructions

Get Pythia contract addresses for on-chain integration. Shows all supported chains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main tool handler for 'get_contracts'. It fetches live data, extracts contract addresses using _get_contracts() helper, tier fees, and formats a human-readable response with all supported chains, consumer contracts, and event registry addresses.
    @mcp.tool()
    async def get_contracts() -> str:
        """Get Pythia contract addresses for on-chain integration. Shows all supported chains."""
        data = await _fetch_data()
        all_contracts = _get_contracts(data)
        fees = _get_tier_fees(data)
        events = data.get("events", {}) if data else {}
    
        lines = ["Pythia Oracle — Contract Addresses\n"]
    
        for chain_key, chain in sorted(all_contracts.items()):
            chain_id = chain.get("chain_id", "?")
            lines.append(f"  {chain['display_name']} (Chain ID {chain_id})")
            lines.append(f"    Operator:            {chain['operator']}")
            lines.append(f"    LINK Token (ERC-677): {chain['link_token']}")
            lines.append("")
            lines.append("    Consumer Contracts (by tier):")
            for tier in ("discovery", "analysis", "speed", "complete"):
                addr = chain["consumers"].get(tier)
                if not addr:
                    continue
                fee_val = fees.get(tier, "?")
                lines.append(f"      {tier.upper()} — {fee_val} LINK")
                lines.append(f"        Address: {addr}")
                lines.append(f"        Returns: {_TIER_RETURNS.get(tier, '?')}")
                lines.append(f"        Job ID:  {_JOB_IDS.get(tier, 'see website')}")
            lines.append("")
    
        # Events registries
        registries = events.get("registries", [])
        if registries:
            lines.append("  Event Registry (indicator alerts):")
            for reg in registries:
                lines.append(f"    {reg['chain']}: {reg['address']}")
            lines.append("")
    
        lines.append(f"  Faucet (free trial): {FAUCET_ADDRESS}")
        lines.append("\nIMPORTANT: Use ERC-677 LINK only (0xb08976...).")
        lines.append("Bridged ERC-20 LINK (0x53e0bc...) does NOT work with Chainlink.")
        lines.append("Use PegSwap (pegswap.chain.link) to convert if needed.")
        return "\n".join(lines)
  • Registration of 'get_contracts' as a FastMCP tool via the @mcp.tool() decorator on line 400.
    @mcp.tool()
    async def get_contracts() -> str:
  • The _get_contracts() helper function that extracts normalized contract data (display_name, chain_id, explorer, operator, link_token, consumers) from the live feed-status.json data.
    def _get_contracts(data: dict) -> dict:
        """Extract normalized contracts from live feed-status.json data.
    
        Raises RuntimeError if the data is missing the developer.contracts section
        (would only happen if generate_site_data.py is broken or schema changed).
        """
        contracts = data.get("developer", {}).get("contracts")
        if not contracts:
            raise RuntimeError(
                "feed-status.json is missing developer.contracts. "
                "This is a structural error in the live data — check the data engine."
            )
    
        result = {}
        for chain_key, chain_data in contracts.items():
            consumers_raw = chain_data.get("consumers", {})
            result[chain_key] = {
                "display_name": chain_data.get("display_name", chain_key),
                "chain_id": chain_data.get("chain_id"),
                "explorer": chain_data.get("explorer", ""),
                "operator": chain_data.get("operator", ""),
                "link_token": chain_data.get("link_token", ""),
                "consumers": _parse_consumers(consumers_raw),
            }
        return result
  • The _parse_consumers() helper function that converts raw consumer contract data from display-name format ('Discovery (0.01 LINK)': '0x...') to normalized tier keys ('discovery': '0x...').
    def _parse_consumers(raw: dict) -> dict[str, str]:
        """Convert {"Discovery (0.01 LINK)": "0x..."} → {"discovery": "0x..."}."""
        parsed = {}
        for display_name, address in raw.items():
            tier = display_name.split()[0].lower() if display_name else ""
            if tier and address:
                parsed[tier] = address
        return parsed
  • The _get_tier_fees() helper used by get_contracts to extract tier fee amounts from live data.
    def _get_tier_fees(data: dict) -> dict[str, float]:
        """Extract tier fees from live feed-status.json data.
    
        Raises RuntimeError if tiers section is missing.
        """
        tiers = data.get("tiers")
        if not tiers:
            raise RuntimeError(
                "feed-status.json is missing the tiers section. "
                "This is a structural error in the live data — check the data engine."
            )
        return {t["id"]: t["fee"] for t in tiers if "id" in t and "fee" in t}
Behavior2/5

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

No annotations provided, and the description only states the action and scope. It does not disclose behavioral traits such as whether the data is cached, rate limits, or any side effects (though it is likely read-only).

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 sentences with no filler. Every word adds value. Very concise and easy to understand.

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?

Given the tool has no parameters and an output schema exists, the description is nearly complete. It clearly states the purpose and output scope. A subtle improvement could be mentioning that it returns a list of addresses per chain.

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?

With zero parameters, the baseline score is 4. The description does not need to add parameter meaning, and the schema coverage is 100%.

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 verb 'Get' and the resource 'contract addresses', specifying the scope 'all supported chains'. This distinguishes it from sibling tools like get_token_feeds or get_pricing.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives or prerequisites. The description implies use for on-chain integration but does not specify when not to use or mention any related tools.

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/pythia-the-oracle/pythia-oracle-mcp'

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