Skip to main content
Glama

calculate_margin

Calculate required margin for up to 20 instruments before placing orders. Provide instrument token, quantity, product type, and transaction type to get the margin requirement.

Instructions

Calculate required margin for instruments (max 20).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "instruments": "<instruments>"
    },
    "name": "calculate_margin"
  }
}

Input Schema

NameRequiredDescriptionDefault
instrumentsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations and no output schema, so the description carries the full burden and does almost nothing with it. It does not say whether the call is read-only, whether margin is computed per instrument or as a net basket figure, what the response contains, or any rate limits; only the 20-instrument cap is disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One short sentence, front-loaded with the verb and resource, and the parenthetical constraint is compact rather than wasteful. It is efficient, though the brevity comes at the cost of substance rather than from trimming redundancy.

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

Completeness3/5

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

For a one-parameter tool this might suffice, but that parameter is a structured array with four required sub-fields and two enums, and there are no annotations or output schema to fall back on. The description supplies the batch-size limit but leaves the agent guessing at field semantics and the shape of the result.

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

Parameters2/5

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

Schema description coverage is 0% and the single parameter is an array of nested objects with four required fields, yet the description explains none of them. The '(max 20)' note is a genuinely useful constraint absent from the schema, but the opaque enum codes ('D', 'I', 'CO', 'MTF') and the meaning of instrument_token/quantity/product remain undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Calculate required margin') for a defined input ('instruments'), which is clearly distinct from the sibling get_funds_margin, which by name retrieves available funds rather than computing a requirement. It stops short of explicitly contrasting itself with any sibling, so it is clear but not fully differentiated.

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

Usage Guidelines2/5

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

The only guidance is the '(max 20)' cap on instruments; there is no statement of when to call this versus get_funds_margin or other margin-related siblings, and no note on prerequisites such as required permissions or whether it is a pre-trade check.

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