Skip to main content
Glama

get_portfolio_strategy

Generate portfolio-aware trading signals by analyzing market questions with position context and correlation analysis to inform strategy decisions.

Instructions

Get a portfolio-aware strategy signal with position context and correlation analysis.

Args: market_query: Description of the bet or market question to analyze. portfolio: Optional list of current positions (dicts with ticker, side, size_usd). bankroll_usd: Total bankroll in USD for position sizing. max_position_pct: Maximum fraction of bankroll per position.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_queryYes
portfolioNo
bankroll_usdNo
max_position_pctNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'get_portfolio_strategy' function is a tool handler that constructs a request body with portfolio and market parameters, then makes an asynchronous POST request to the '/v1/signals/portfolio' endpoint to retrieve a strategy signal.
    @mcp.tool()
    async def get_portfolio_strategy(
        market_query: str,
        portfolio: list[dict] | None = None,
        bankroll_usd: float = 10000.0,
        max_position_pct: float = 0.05,
    ) -> str:
        """Get a portfolio-aware strategy signal with position context and correlation analysis.
    
        Args:
            market_query: Description of the bet or market question to analyze.
            portfolio: Optional list of current positions (dicts with ticker, side, size_usd).
            bankroll_usd: Total bankroll in USD for position sizing.
            max_position_pct: Maximum fraction of bankroll per position.
        """
        body: dict = {
            "market_query": market_query,
            "bankroll_usd": bankroll_usd,
            "max_position_pct": max_position_pct,
        }
        if portfolio:
            body["portfolio"] = portfolio
        return await _request("POST", "/v1/signals/portfolio", json=body)
Behavior2/5

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

No annotations provided, so description carries full burden. While it discloses the analytical components (correlation analysis), it fails to mention critical behavioral traits: whether it executes trades (vs. shadow/analysis only), rate limits, caching behavior, or idempotency. The 'Get' prefix suggests read-only but this is not confirmed.

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?

Uses efficient Python-docstring style with clear separation between purpose statement and Args documentation. No redundant text; every line serves either functional description or parameter clarification given the lack of schema metadata.

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?

Comprehensive for inputs given the parameter documentation and presence of output schema (which removes need to describe returns). Would benefit from explicit statement that this is an analytical/read-only operation (does not modify positions), but otherwise complete for a 4-parameter strategy tool.

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?

With 0% schema description coverage, the Args section provides essential documentation for all 4 parameters. It clarifies semantics (e.g., 'market_query' is for 'bet or market question', 'portfolio' contains dicts with specific keys) and units (USD for bankroll, fraction for max_position_pct), fully compensating for the bare schema.

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?

Description provides specific verb ('Get') + resource ('portfolio-aware strategy signal') + key differentiators ('position context and correlation analysis'). Clearly distinguishes from sibling 'get_strategy' by emphasizing portfolio-awareness and from 'get_correlation' by combining correlation with strategy generation.

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 phrase 'portfolio-aware' and mention of 'position context' implies usage when existing positions are held, but lacks explicit when-to-use/when-not-to-use guidance. Does not explicitly contrast with sibling 'get_strategy' to clarify selection criteria.

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