Skip to main content
Glama

analyze_fill_cost

Calculates expected trade cost or proceeds for a given quantity by walking the order book to account for slippage, then returns fill breakdowns, VWAP, and limit price guidance.

Instructions

Calculate expected cost/proceeds for a specific quantity.

Walks the order book to account for slippage when executing a trade.

Args:
    ticker: Material ticker symbol (e.g., "RAT"). Single ticker only.
    exchange: Exchange code (e.g., "CI1").
              Valid: AI1, CI1, CI2, IC1, NC1, NC2.
    quantity: Number of units to buy or sell.
    direction: "buy" or "sell".

Returns:
    TOON-encoded fill analysis including fills breakdown, VWAP,
    slippage, and limit price recommendations.

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": {
      "ticker": "<ticker>",
      "exchange": "<exchange>",
      "quantity": "<quantity>",
      "direction": "<direction>"
    },
    "name": "analyze_fill_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
tickerYes
exchangeYes
quantityYes
directionYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does reasonably well: it discloses the non-obvious behavioral trait that the calculation walks the order book and models slippage, and it names what the result contains (fills breakdown, VWAP, slippage, limit price recommendations). It stops short of stating what happens if quantity exceeds available book depth or whether the operation is purely a read, which is the main remaining gap.

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?

The purpose is front-loaded in one sentence, followed by a mechanism sentence and a compact Args/Returns block. Every element is relevant, though the docstring-style layout is slightly verbose for a four-parameter tool.

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?

All four required parameters are documented and an output schema already exists, so the Returns note is a bonus rather than a necessity. For a read-only calculation the description is close to complete; only edge-case behavior (insufficient book depth, unknown ticker/exchange handling) is absent.

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

Parameters5/5

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

Schema description coverage is 0% and no enums exist in the schema, yet the description compensates fully: it enumerates the valid exchange codes (AI1, CI1, CI2, IC1, NC1, NC2), constrains direction to 'buy'/'sell', clarifies 'single ticker only', and explains that quantity is units to buy or sell. This adds constraints and vocabularies the structured schema entirely lacks.

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?

States a specific verb and resource ('Calculate expected cost/proceeds for a specific quantity') and immediately names the mechanism ('walks the order book to account for slippage'), which separates it from the static recipe/building cost calculators among its siblings. An agent can tell this is a market-execution cost estimator, not a production-cost calculator, without opening the schema.

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?

Usage is only implied: the slippage/order-book framing suggests it should be used when realistic execution cost matters rather than a naive price lookup, but the description never states when to prefer it over get_order_book_depth or get_exchange_prices, nor any prerequisite or exclusion.

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