Skip to main content
Glama

Agent Financial Advisor

Pre-trade compliance and risk check

pre_trade_check

Run an order past a compliance officer and risk manager before sending it to the broker. Checks buying power, cash-account settlement violations, FINRA intraday margin (post-PDT) or legacy PDT limits, Reg SHO short-sale rules, wash-sale exposure, position concentration, per-trade risk versus stop, liquidity, spread, fat-finger prices, leverage and market hours. Returns approve / approve_with_warnings / reject with reasons and a resized quantity when useful. Price: $0.005.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "order": {
        "side": "buy",
        "symbol": "AAPL",
        "quantity": 50,
        "limit_price": 200,
        "stop_loss_price": 190
      },
      "market": {
        "ask": 200.02,
        "bid": 199.98,
        "last_price": 200,
        "avg_daily_volume": 50000000
      },
      "account": {
        "type": "margin",
        "equity": 100000,
        "positions": []
      }
    },
    "name": "pre_trade_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
orderYes
marketNo
policyNoOverride risk limits. Defaults: {"max_position_pct":0.2,"max_order_risk_pct":0.02,"max_adv_pct":0.05,"max_spread_pct":0.01,"max_gross_leverage":2,"max_limit_deviation_pct":0.1,"allow_short":true,"allow_extended_hours":false,"require_stop":false}
accountYesAccount state before the order.
api_keyNoOptional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / api_key
      Added value: +{
      +  "description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial.",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "account": {
      +      "equity": 100000,
      +      "positions": [],
      +      "type": "margin"
      +    },
      +    "market": {
      +      "ask": 200.02,
      +      "avg_daily_volume": 50000000,
      +      "bid": 199.98,
      +      "last_price": 200
      +    },
      +    "order": {
      +      "limit_price": 200,
      +      "quantity": 50,
      +      "side": "buy",
      +      "stop_loss_price": 190,
      +      "symbol": "AAPL"
      +    }
      +  }
      +]
  3. First observed

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations at all, the description carries the full behavioral burden. It does good work disclosing outcomes ('approve / approve_with_warnings / reject with reasons and a resized quantity') and cost ($0.005), which compensates for the missing output schema, but it never explicitly states that the check does not submit or mutate the order, and it says nothing about the api_key / credit requirement described in the schema.

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?

Front-loaded with the core action, and the long check enumeration is informative rather than filler. It is a dense single block with no paragraph breaks, which makes the return-format and price sentences easy to skim past.

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 nested, five-parameter tool with no annotations, no output schema, and only 60% schema coverage, the description covers the semantic core (what is checked, what is returned) but leaves gaps: sibling routing, api_key/credit implications, and whether partial inputs (e.g., missing market data) degrade gracefully.

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 coverage is 60%, so the schema already documents much of the input. The description adds real meaning by mapping checks to inputs ('per-trade risk versus stop', 'wash-sale exposure', 'buying power', 'market hours'), letting an agent infer why stop_loss_price and recent_sales matter, but it says nothing about the policy override object or how defaults can be relaxed, which is the least self-explanatory parameter.

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 opens with a specific verb and resource ('Run an order past a compliance officer and risk manager') and then enumerates the exact rule set checked, which makes the tool's scope unmistakable. It stops short of naming the sibling checks it must be distinguished from (options_risk_check, suitability_check), so an agent could still hesitate between this and those.

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?

'before sending it to the broker' implies the timing of use, but there is no explicit when-to-use vs when-to-skip statement and no mention of the alternative tools (options_risk_check, suitability_check, position_size) or how they compose with this one. Usage is inferable but not guided.

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.