get_market_summary
Retrieve a system-wide summary of all tokens tracked by Pythia, including operational status, uptime distribution, and data source health for quick system health assessment.
Instructions
Get a summary of all tokens tracked by Pythia with operational overview.
Returns system-wide stats, tokens grouped by status, uptime distribution, data source health, and infrastructure status. Useful for quickly understanding what Pythia covers and whether the system is healthy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/pythia_oracle_mcp/server.py:257-322 (handler)The get_market_summary tool handler function. Fetches live data from feed-status.json and returns a system overview with tokens grouped by status, ecosystem coverage, data source health, and infrastructure status.
@mcp.tool() async def get_market_summary() -> str: """Get a summary of all tokens tracked by Pythia with operational overview. Returns system-wide stats, tokens grouped by status, uptime distribution, data source health, and infrastructure status. Useful for quickly understanding what Pythia covers and whether the system is healthy. """ data = await _fetch_data() tokens = data.get("tokens", []) stats = data.get("stats", {}) system = data.get("system", {}) generated = data.get("generated_at", "unknown") lines = [f"Pythia Oracle — System Overview (as of {generated})\n"] # Overall stats lines.append("System Stats:") lines.append(f" Tokens: {stats.get('tokens', '?')}") lines.append(f" Indicator feeds: {stats.get('total_indicators', '?')}") lines.append(f" Chains: {stats.get('chains', '?')}") lines.append(f" Ecosystems: {stats.get('ecosystems', '?')}") lines.append(f" Avg response: {stats.get('avg_response_ms', '?')}ms") lines.append(f" Active incidents: {stats.get('active_incidents', 0)}") lines.append("") # Tokens by status by_status: dict[str, list[str]] = {} for t in tokens: s = t.get("status", "unknown") by_status.setdefault(s, []).append(t["symbol"]) lines.append("Tokens by Status:") for status in ["live", "warn", "down", "unknown"]: if status in by_status: syms = ", ".join(sorted(by_status[status])) lines.append(f" {status:<6} ({len(by_status[status])}): {syms}") lines.append("") # Tokens by ecosystem by_eco: dict[str, list[str]] = {} for t in tokens: eco = t.get("ecosystem", "Other") by_eco.setdefault(eco, []).append(t["symbol"]) lines.append("Coverage by Ecosystem:") for eco, syms in sorted(by_eco.items(), key=lambda x: -len(x[1])): lines.append(f" {eco:<20} {len(syms)} tokens: {', '.join(sorted(syms))}") lines.append("") # Data sources sources = system.get("sources", []) if sources: lines.append("Data Sources:") for s in sources: lines.append(f" {s['name']:<15} status: {s['status']} (tier {s['tier']})") lines.append("") # Infrastructure infra = system.get("infrastructure", {}) if infra: lines.append("Infrastructure:") for component, status in infra.items(): lines.append(f" {component:<15} {status}") return "\n".join(lines) - src/pythia_oracle_mcp/server.py:257-258 (registration)Registration via @mcp.tool() decorator on the async function get_market_summary. The FastMCP instance 'mcp' is created at line 17.
@mcp.tool() async def get_market_summary() -> str: