Skip to main content
Glama
zionto

ibkr-mcp

by zionto

flex_parse_fifo_pnl

Extract FIFO realized and unrealized P&L from Interactive Brokers Flex XML reports. Filter by symbol or asset category to get summarized profit and loss data.

Instructions

Extract FIFO realized/unrealized P&L summary from a Flex XML report.

Args: xml_content: Raw Flex XML string. symbol: Filter by ticker symbol (case-insensitive, optional). asset_category: Filter by asset category e.g. STK, OPT, FUT (optional).

Returns JSON: {"count": N, "total_realized": "...", "total_unrealized": "...", "rows": [...]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNo
xml_contentYes
asset_categoryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries full responsibility. It discloses the return JSON structure and parameter behaviors (case-insensitive symbol filtering, optional filters), but does not mention error handling, behavior on empty results, or whether the XML is validated. This adds useful context but omits some behavioral details.

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 concise and well-structured: a one-sentence purpose, a clearly labeled Args block, and a Returns line with the exact JSON shape. No filler or redundant information—every sentence contributes to understanding the tool.

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?

The description covers purpose, parameters, and output format, which is sufficient for a relatively simple parsing tool. It does not mention how to obtain the XML (e.g., via flex_send_request) or potential limitations, but these are not critical gaps given the presence of an output schema and sibling context.

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?

Schema description coverage is 0%, and the description fully compensates by explaining each parameter: xml_content is 'Raw Flex XML string,' symbol is 'Filter by ticker symbol (case-insensitive, optional),' and asset_category is 'Filter by asset category e.g. STK, OPT, FUT (optional).' This adds essential semantic meaning beyond the bare schema types.

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?

The description begins with 'Extract FIFO realized/unrealized P&L summary from a Flex XML report,' which uses a specific verb ('Extract'), resource ('Flex XML report'), and output ('FIFO realized/unrealized P&L summary'). This clearly differentiates it from sibling tools like flex_parse_trades or flex_analyze_pnl by focusing on FIFO P&L specifically.

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 by indicating it works on Flex XML reports and supports filtering, but it does not explicitly state when to choose this tool over alternatives (e.g., flex_analyze_pnl). No exclusions or alternative references are provided, leaving the agent to infer based on the tool name and description.

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/zionto/ibkr-mcp'

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