Skip to main content
Glama
gtorreal
by gtorreal

calculate_position_size

Calculate how many units to trade based on your capital, risk percentage, entry price, and stop-loss to ensure losses stay within your risk tolerance.

Instructions

Calculates position size based on your capital, risk tolerance, entry price, and stop-loss. Determines how many units to buy or sell so that a stop-loss hit costs exactly risk_pct% of capital. Fully client-side — no API call is made. Example: 'How many BTC can I buy on BTC-CLP if I have 1,000,000 CLP, risk 2%, entry 80,000,000 CLP, stop at 78,000,000 CLP?'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket ID (e.g. 'BTC-CLP', 'ETH-COP'). Used to derive the quote currency.
capitalYesTotal available capital in the quote currency (e.g. CLP for BTC-CLP).
risk_pctYesPercentage of capital to risk on this trade (0.1–10, e.g. 2 = 2%).
entry_priceYesPlanned entry price in quote currency.
stop_loss_priceYesStop-loss price in quote currency. Must be below entry for buys, above entry for sells.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively explains key traits: it's a client-side calculation (no API call), specifies the risk logic ('costs exactly risk_pct% of capital'), and includes an example. It could add more on error handling or output format but covers core behavior well.

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 appropriately sized and front-loaded, with the core purpose stated first, followed by behavioral details and a practical example. Every sentence adds value without redundancy, making it efficient and easy to parse.

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?

Given the tool's complexity (financial calculation with 5 parameters), no annotations, and no output schema, the description is largely complete. It explains the tool's function, behavior, and includes an example. A minor gap is the lack of explicit output format, but the example implies a numeric result, making it adequate for use.

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 schema already documents all parameters thoroughly. The description adds marginal value by summarizing parameters in context ('capital, risk tolerance, entry price, and stop-loss') and illustrating them in the example, but does not provide additional syntax or format details beyond the schema.

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 clearly states the tool's purpose with specific verbs ('calculates position size', 'determines how many units to buy or sell') and resources (capital, risk tolerance, entry price, stop-loss). It distinguishes from sibling tools by focusing on position sizing rather than market data, arbitrage, or order simulation.

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 for when to use this tool ('based on your capital, risk tolerance, entry price, and stop-loss') and includes an example scenario. However, it does not explicitly state when not to use it or name specific alternatives among sibling tools, though the purpose inherently differentiates it.

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/gtorreal/buda-mcp'

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