Skip to main content
Glama

Calculate crypto capital gains (FIFO) per SA tax year

crypto_gains_fifo
Read-only

Calculates South African capital gains and losses on crypto from a list of buys, sells, crypto-to-crypto swaps, spends, gifts and crypto income, using first-in-first-out (SARS accepts FIFO or specific identification; weighted average is not allowed). Returns each disposal's proceeds, base cost and gain, totals per tax year (1 March – end February), income to declare, and holdings left with their base cost. Optionally estimates the tax per year.

Input Schema

NameRequiredDescriptionDefault
treatmentNocapital (investor) or revenue (trader: gains taxed in full as income). Use crypto_capital_or_revenue if unsurecapital
estimate_taxNoOptional: also estimate the tax per tax year
transactionsYesEvery acquisition and disposal, any order (sorted by date; same-day keeps the given order). Include all earlier purchases of an asset, or the gain is overstated.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the readOnlyHint, the description discloses the calculation method, SARS treatment rules, tax-year boundaries, and the main return categories, including per-disposal proceeds, base cost, gain, yearly totals, income, and remaining holdings. It still omits some behavioral details such as rounding, error handling, and how same-day ordering is managed, though the schema covers ordering.

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 front-loaded, uses two efficient sentences, and every clause contributes relevant scope or output information. The parenthetical note on SARS accepting FIFO but not weighted average earns its place because it explains the chosen method.

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?

There is no output schema, so the description appropriately explains the main return categories and optional tax estimate. For a nested transaction-based calculator, it is largely complete, though it could say more about input assumptions such as rand valuation and handling of incomplete history, which the schema only partly covers.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents the transaction fields, treatment enum, and optional tax-estimate object thoroughly. The description adds useful framing about which transaction types are accepted, but it does not provide parameter-level semantics beyond what the schema already supplies.

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 a specific verb and resource: it calculates South African capital gains and losses on crypto from a transaction list using FIFO. It also defines the tax-year scope and output categories, so an agent can distinguish it from a simple tax estimator or a capital-versus-revenue classifier.

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 makes clear that this tool performs the full FIFO gains calculation and can optionally estimate tax, which implies it is the right choice when disposal-level gains are needed. However, it does not explicitly say when to use this instead of crypto_tax_estimate or crypto_capital_or_revenue, and it gives no exclusions or prerequisites.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources