Skip to main content
Glama

Return on investment (ROI)

smartfin_calculate_roi
Read-onlyIdempotent

The profit or loss and the ROI percentage from an initial investment and a final value (ROI = (final - initial) / initial x 100). Negative results are valid. It is not annualized. Use for questions about the total percentage return on money put in, from two values. Do not use for a return per year (use the CAGR calculator at smartfin.fyi/cagr-calculator.html), for what a real stock returned (use smartfin_calculate_investment_return), or for fees and taxes: include them in the final value yourself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currencyNoCurrency symbol for the amounts in the summary only; amounts are never converted. The link opens the page in US dollars, and how_to says to pick the currency there. Default USD
final_valueYesFinal value in the currency chosen; it can be below the initial amount
initial_valueYesInitial investment in the currency chosen, above 0

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
citeYesHow to credit this result
dataYes
nextYesSuggested follow-up calls
linksYes
how_toYesSteps for the user to see or redo this on smartfin.fyi
sourceYes
summaryYesPlain-language result the assistant can quote

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / currency
      Added value: +{
      +  "description": "Currency symbol for the amounts in the summary only; amounts are never converted. The link opens the page in US dollars, and how_to says to pick the currency there. Default USD",
      +  "enum": [
      +    "USD",
      +    "EUR",
      +    "GBP",
      +    "CHF",
      +    "AUD",
      +    "CAD",
      +    "SGD",
      +    "HKD",
      +    "INR",
      +    "JPY"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / final_value / description
      Previous value: -"Final value in dollars; it can be below the initial amount"New value: +"Final value in the currency chosen; it can be below the initial amount"
    • changedInput schema / properties / initial_value / description
      Previous value: -"Initial investment in dollars, above 0"New value: +"Initial investment in the currency chosen, above 0"
  2. Added

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so the safety profile is covered. The description adds genuinely non-obvious behavior: negative results are valid, the figure is not annualized, and fees/taxes are the caller's responsibility to fold into final_value. Return format is left to the output schema, which exists.

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?

Formula and the 'negative results are valid / not annualized' caveats are front-loaded, then usage boundaries, then the fees/taxes caveat last. Every sentence carries distinct information; nothing is redundant with the title or annotations.

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?

For a simple two-input calculator with a full output schema and complete annotation coverage, the description supplies everything an agent needs: formula, valid-input ranges implied by semantics, edge cases, and routing to alternatives. No material gap remains.

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 description coverage is 100%, so baseline is 3. The description adds interpretation value beyond the schema by clarifying that final_value may legitimately fall below initial_value and that fees/taxes must be embedded there, plus the non-conversion of currency.

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?

Names a specific verb and resource (calculate ROI), gives the exact formula, and states scope boundaries: 'not annualized', 'two values'. It clearly distinguishes itself from siblings like smartfin_calculate_investment_return and the CAGR calculator without requiring the agent to open any schema.

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

Usage Guidelines5/5

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

Explicit when-to-use ('questions about the total percentage return on money put in, from two values') and three explicit when-not-to-use cases, each with the correct alternative named (CAGR calculator link, smartfin_calculate_investment_return) plus handling guidance for fees/taxes. Nothing is left to inference.

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