Skip to main content
Glama
ninetails-io

gnucash-mcp

calculate_lot_gain

Read-only

Calculate actual or hypothetical capital gain for an investment lot, using either current market data or a custom sale price and share count.

Instructions

Calculate potential or actual capital gain for a lot.

If shares and sale_price provided, calculates hypothetical gain. Otherwise uses lot's current state and latest price.

Args: lot_guid: Lot GUID (or 8+ char prefix). shares: Optional number of shares to calculate for. Defaults to all remaining shares. sale_price: Optional sale price per share. Defaults to latest price for the commodity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sharesNo
lot_guidYesLot GUID (32-char hex or 8+ char prefix)
sale_priceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.2

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already convey readOnlyHint=true, so safety is established. The description adds meaningful behavioral detail: the two calculation paths, defaulting shares to all remaining, and defaulting sale_price to latest price. This goes beyond what annotations provide and is consistent with them.

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 compact and efficiently structured: purpose, mode logic, then parameter details. No sentence is wasted, and the most important behavioral distinction is front-loaded.

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?

With an output schema present, return-value documentation is unnecessary. The description covers the two usage modes and defaults adequately. The only minor gap is ambiguity about partial combinations, such as providing sale_price without shares, but overall the agent has enough to call the tool correctly.

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?

Schema coverage is only 33%, and the description compensates by documenting all three parameters, including defaults for shares and sale_price. This gives the agent critical meaning that the schema lacks for two parameters, though it stops short of specifying units or edge-case behavior.

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 opens with a specific verb and resource: 'Calculate potential or actual capital gain for a lot.' This clearly distinguishes the tool from siblings like get_lot or get_latest_price, which retrieve data but do not compute gain.

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 explicit mode-based guidance: if both shares and sale_price are provided, compute hypothetical gain; otherwise, use the lot's current state and latest price. This is clear usage context, though it does not name sibling alternatives or state when not to use the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.