get_feed_value
Obtain the current value of a Pythia indicator feed to sanity-check levels or inform event threshold decisions.
Instructions
Get the latest computed value of a Pythia indicator feed.
Reads from the live cache (feed_values table) populated by the indicator pipeline on every cycle. Off-chain AI agents use this when reasoning about a Vision context, choosing an Event threshold, or sanity-checking a feed's current level. On-chain consumers should request the value through oracle.request() to get a Chainlink-attested response — see get_integration_guide().
Args: feed_name: full feed name (e.g. 'bitcoin_RSI_1H_14', 'pol_EMA_5M_20').
Returns: Latest value + computed_at + chain, one block per chain if a feed exists on multiple chains. If the feed has no cached value, returns a diagnostic pointer (warm-up window, deactivated, or unknown name).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| feed_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- The `get_feed_value` tool function: fetches the latest computed value of a Pythia indicator feed from the live cache (feed_values_current in feed-status.json). It looks up matching feed names and returns the value, chain, and computed_at timestamp per chain. If not found, returns a diagnostic message.
@mcp.tool() async def get_feed_value(feed_name: str) -> str: """Get the latest computed value of a Pythia indicator feed. Reads from the live cache (feed_values table) populated by the indicator pipeline on every cycle. Off-chain AI agents use this when reasoning about a Vision context, choosing an Event threshold, or sanity-checking a feed's current level. On-chain consumers should request the value through oracle.request() to get a Chainlink-attested response — see get_integration_guide(). Args: feed_name: full feed name (e.g. 'bitcoin_RSI_1H_14', 'pol_EMA_5M_20'). Returns: Latest value + computed_at + chain, one block per chain if a feed exists on multiple chains. If the feed has no cached value, returns a diagnostic pointer (warm-up window, deactivated, or unknown name). """ data = await _fetch_data() feeds = data.get("feed_values_current", []) if data else [] matches = [f for f in feeds if f.get("feed_name") == feed_name] if not matches: return ( f"Feed '{feed_name}' has no current value in the live cache.\n" "Possible reasons:\n" " - Feed name not registered (use list_tokens() + " "get_token_feeds(engine_id) to discover)\n" " - Feed inside its warm-up window (1H/1D/1W indicators on " "freshly-onboarded tokens)\n" " - Pipeline degraded — check check_oracle_health()" ) out = [f"Feed: {feed_name}"] for m in matches: out.append("") out.append(f" Chain: {m.get('chain')}") out.append(f" Value: {m.get('value')}") out.append(f" Computed at: {m.get('computed_at')}") out.append("") out.append( "Cached value updated by the indicator pipeline. For a Chainlink-" "attested on-chain value, use oracle.request() — see " "get_integration_guide()." ) return "\n".join(out) - The tool's docstring serves as its schema: defines the 'feed_name' string parameter and describes the return format (value + computed_at + chain). Input is validated implicitly by matching against the live cache.
async def get_feed_value(feed_name: str) -> str: """Get the latest computed value of a Pythia indicator feed. Reads from the live cache (feed_values table) populated by the indicator pipeline on every cycle. Off-chain AI agents use this when reasoning about a Vision context, choosing an Event threshold, or sanity-checking a feed's current level. On-chain consumers should request the value through oracle.request() to get a Chainlink-attested response — see get_integration_guide(). Args: feed_name: full feed name (e.g. 'bitcoin_RSI_1H_14', 'pol_EMA_5M_20'). Returns: Latest value + computed_at + chain, one block per chain if a feed exists on multiple chains. If the feed has no cached value, returns a diagnostic pointer (warm-up window, deactivated, or unknown name). """ - src/pythia_oracle_mcp/server.py:1335-1336 (registration)The `@mcp.tool()` decorator registers the function as an MCP tool named 'get_feed_value'.
@mcp.tool() async def get_feed_value(feed_name: str) -> str: