Skip to main content
Glama
VaishnaviK23

Trading MCP Server

by VaishnaviK23

pnl

Calculate Profit & Loss by combining realized and unrealized gains into a single financial summary for trading analysis.

Instructions

Generate a Profit & Loss (P&L) summary.

Combines realized and unrealized gains into a single financial overview.

Returns: A dictionary with keys 'realized' and 'unrealized' representing the total gains.

Example: pnl() -> {"realized": 320.75, "unrealized": 145.60}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `pnl` tool is defined as an MCP tool using the `@mcp.tool()` decorator. It calculates the Profit & Loss summary by calling `realized_gains()` and summing the results of `unrealized_gains()`.
    @mcp.tool()
    def pnl() -> dict[str, float]:
        """Generate a Profit & Loss (P&L) summary.
    
        Combines realized and unrealized gains into a single financial overview.
    
        Returns:
            A dictionary with keys 'realized' and 'unrealized' representing the total gains.
    
        Example:
            pnl() -> {"realized": 320.75, "unrealized": 145.60}
        """
        return {
            'realized': realized_gains(),
            'unrealized': sum(unrealized_gains().values())
        }
Behavior3/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. It explains the aggregation behavior ('Combines') and documents the return structure with an example. However, it lacks disclosure of other behavioral traits like data freshness, calculation methodology (e.g., all-time vs period-specific), rate limits, or side effects.

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 efficiently structured with a clear purpose statement, behavioral clarification, and a documented return value with an example. Every sentence earns its place; there is no redundant or tautological language.

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

Completeness5/5

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

Given the tool's simplicity (zero parameters, single aggregation operation) and the presence of an output schema (per context signals), the description is complete. It adds value by explaining the aggregation logic and providing a concrete example, which complements the structured schema without being redundant.

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 input schema contains zero parameters. According to the baseline rules, zero parameters warrants a baseline score of 4. The description correctly does not invent parameter documentation where none exist.

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 states the specific action 'Generate' and resource 'Profit & Loss (P&L) summary'. It clearly distinguishes itself from siblings 'realized_gains' and 'unrealized_gains' by specifying it 'Combines realized and unrealized gains into a single financial overview', positioning it as the aggregate view.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context that this tool aggregates both types of gains, implicitly signaling to use it when a combined overview is needed versus the individual sibling tools. However, it does not explicitly name the alternatives or state when NOT to use it (e.g., 'use realized_gains instead for tax reporting').

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/VaishnaviK23/Trading-MCP-Server'

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