Skip to main content
Glama

get_correlation

Compute cross-market correlation graphs to analyze portfolio diversification across prediction markets. Specify market IDs, platform, and time period to identify relationships for risk management.

Instructions

Compute cross-market correlation graph for portfolio diversification analysis.

Args: market_ids: List of market IDs to correlate (minimum 2). platform: Platform: "kalshi" or "polymarket". period: Lookback period: "48h", "7d", or "30d".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idsYes
platformNokalshi
periodNo7d

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `get_correlation` tool is defined here using the `@mcp.tool()` decorator, which handles its registration, and calls an internal `_request` helper to fetch correlation data.
    @mcp.tool()
    async def get_correlation(
        market_ids: list[str], platform: str = "kalshi", period: str = "7d"
    ) -> str:
        """Compute cross-market correlation graph for portfolio diversification analysis.
    
        Args:
            market_ids: List of market IDs to correlate (minimum 2).
            platform: Platform: "kalshi" or "polymarket".
            period: Lookback period: "48h", "7d", or "30d".
        """
        return await _request(
            "POST",
            "/v1/correlation",
            json={"market_ids": market_ids, "platform": platform, "period": period},
        )
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the computational nature ('Compute') and the constraint that market_ids requires 'minimum 2' IDs. However, it lacks other behavioral traits like whether results are cached, idempotency, computational cost, or specific correlation methodology used.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with the action and purpose front-loaded in the first sentence, followed by a compact Args block. Every element serves a purpose—either establishing the tool's function or documenting parameters. Minor improvement possible by integrating the 'minimum 2' constraint into the main narrative.

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 presence of an output schema (covering return values) and the Args block (covering parameters), the description provides sufficient information for invocation. It appropriately omits return value details (handled by output schema) but could enhance completeness by mentioning the correlation calculation method (e.g., Pearson) or data freshness.

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?

Excellent compensation for 0% schema description coverage. The Args block documents all three parameters: market_ids (with minimum constraint), platform (explicitly listing valid values 'kalshi' or 'polymarket'), and period (listing valid values '48h', '7d', or '30d'). This provides critical semantic information entirely missing from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'Compute[s] cross-market correlation graph' with the specific use case of 'portfolio diversification analysis.' The 'cross-market' qualifier effectively distinguishes it from siblings like analyze_market (single-market focus) and get_arbitrage (price disparity focus), though it doesn't explicitly name alternatives.

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 implies usage context through 'for portfolio diversification analysis,' suggesting when the tool is valuable. However, it lacks explicit guidance on when NOT to use it or which siblings to prefer for other tasks (e.g., 'use get_arbitrage for price differences instead').

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/Rekko-AI/rekko-mcp'

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