Skip to main content
Glama

get_account_info

Retrieve Alpaca account details such as equity, buying power, and day trade status for portfolio management and trading strategy development.

Instructions

Get detailed Alpaca account information including equity, buying power, and day trade status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:37-56 (handler)
    The MCP tool handler implementation for 'get_account_info'. It fetches the Alpaca account details using get_broker() and formats them into a readable string. Registered via @mcp.tool() decorator.
    @mcp.tool()
    def get_account_info() -> str:
        """
        Get detailed Alpaca account information including equity, buying power, and day trade status.
        """
        try:
            broker = get_broker()
            account = broker.get_account()
            
            return f"""
    === ALPACA ACCOUNT INFO ===
    Cash: ${account['cash']:,.2f}
    Equity: ${account['equity']:,.2f}
    Buying Power: ${account['buying_power']:,.2f}
    Portfolio Value: ${account['portfolio_value']:,.2f}
    Pattern Day Trader: {account['pattern_day_trader']}
    Day Trade Count: {account['daytrade_count']}
    """
        except Exception as e:
            return f"ERROR: Failed to get account info - {str(e)}"
  • server.py:37-56 (registration)
    The @mcp.tool() decorator registers get_account_info as an MCP tool.
    @mcp.tool()
    def get_account_info() -> str:
        """
        Get detailed Alpaca account information including equity, buying power, and day trade status.
        """
        try:
            broker = get_broker()
            account = broker.get_account()
            
            return f"""
    === ALPACA ACCOUNT INFO ===
    Cash: ${account['cash']:,.2f}
    Equity: ${account['equity']:,.2f}
    Buying Power: ${account['buying_power']:,.2f}
    Portfolio Value: ${account['portfolio_value']:,.2f}
    Pattern Day Trader: {account['pattern_day_trader']}
    Day Trade Count: {account['daytrade_count']}
    """
        except Exception as e:
            return f"ERROR: Failed to get account info - {str(e)}"
  • Duplicate implementation used in the Gradio UI dashboard.
    def get_account_info() -> str:
        try:
            broker = get_broker()
            account = broker.get_account()
            return f"""
    === ALPACA ACCOUNT INFO ===
    Cash: ${account['cash']:,.2f}
    Equity: ${account['equity']:,.2f}
    Buying Power: ${account['buying_power']:,.2f}
    Portfolio Value: ${account['portfolio_value']:,.2f}
    Pattern Day Trader: {account['pattern_day_trader']}
    Day Trade Count: {account['daytrade_count']}
    """
        except Exception as e:
            return f"ERROR: Failed to get account info - {str(e)}"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It implies a read-only operation by using 'Get', but doesn't specify if it's safe, has rate limits, requires specific permissions, or what the output format entails. For a tool with zero annotation coverage, this is a significant gap in behavioral context.

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?

The description is a single, efficient sentence that front-loads the key action and details. Every word earns its place by specifying the tool's function and key data points without any waste or fluff, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, with no annotations and sibling tools that might overlap, it lacks completeness in behavioral and usage context. It meets the baseline for a simple read tool but doesn't provide enough guidance for optimal agent use.

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 tool has 0 parameters, and the input schema has 100% coverage (though empty). The description doesn't need to explain parameters, so it appropriately avoids redundancy. A baseline of 4 is assigned as it doesn't add unnecessary param info, but it doesn't fully compensate for other gaps, so it's not a 5.

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's purpose with a specific verb ('Get') and resource ('Alpaca account information'), and lists key data fields (equity, buying power, day trade status). However, it doesn't explicitly differentiate from sibling tools like 'get_positions' or 'get_order_history', which might also retrieve account-related data, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, such as whether it requires authentication or if it's for real-time vs. historical data. This leaves the agent without usage direction beyond the basic purpose.

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/N-lia/MonteWalk'

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