Skip to main content
Glama
l4b4r4b4b4
by l4b4r4b4b4

get_drawdown_analysis

Analyze portfolio drawdowns to assess risk. Calculates maximum drawdown, drawdown periods, current drawdown, and recovery needed.

Instructions

Analyze portfolio drawdowns.

    Calculates maximum drawdown and drawdown periods for the
    portfolio, useful for risk assessment.

    Args:
        name: The portfolio name.

    Returns:
        Dictionary containing:
        - max_drawdown: Maximum drawdown percentage
        - max_drawdown_period: Start and end dates of max drawdown
        - current_drawdown: Current drawdown from peak
        - recovery_needed: Percentage gain needed to recover

    Example:
        ```
        result = get_drawdown_analysis(name="tech_stocks")
        print(f"Max Drawdown: {result['max_drawdown']:.2%}")
        ```
    

Caching Behavior:

  • Any input parameter can accept a ref_id from a previous tool call

  • Large results return ref_id + preview; use get_cached_result to paginate

  • All responses include ref_id for future reference

Preview Size: server default. Override per-call with get_cached_result(ref_id, max_size=...).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

The description includes caching behavior and return value structure, but fails to explicitly state that this is a read-only operation (no destructive hint). Given no annotations, the description should more clearly indicate it does not modify data.

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

Conciseness3/5

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

The description is overly long, including docstring formatting (Args, Returns, Example) and generic caching instructions that are not tool-specific. The core purpose is front-loaded, but the additional text could be trimmed or abstracted to improve conciseness.

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 simple nature of the tool (one parameter, clear output described), the description adequately covers what it does and what it returns. However, it could mention that the portfolio must exist before calling this tool.

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?

The only parameter 'name' is fully explained as 'The portfolio name', adding meaning beyond the bare schema. Since schema coverage is 0% (no property descriptions), the description compensates well for the single parameter.

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 it analyzes portfolio drawdowns by calculating maximum drawdown and drawdown periods, which is a specific action. However, it does not distinguish itself from sibling tools like 'get_portfolio_metrics' or 'get_correlation_matrix' that may also involve risk assessment.

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 is provided on when to use this tool versus alternatives such as 'get_portfolio_metrics' or 'run_monte_carlo'. It only mentions it is 'useful for risk assessment', which is too vague to inform tool selection.

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/l4b4r4b4b4/portfolio-mcp'

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