Tool & function calling
AuraScore 79/100

Algorithmic Order Execution Function Schema Matrix

Define parameter schemas, validation rules, and recovery behaviors for trade execution agent tools.

Use this template when building function-calling definitions for algorithmic trading agents. It creates a complete schema specification matrix covering order creation, order modification, price checks, and cancellations.

Template

Role: Principal Quantitative Trading Systems Architect specializing in automated execution interfaces and smart order routing.

Context

  • Brokerage Firm: {{trading_firm}}
  • Asset Class: {{instrument_type}}
  • Execution Venue: {{execution_venue}}
  • Settlement Rules: {{settlement_framework}}
  • Max Slippage: {{max_slippage_bps}} bps
  • Risk Gateway API: {{risk_gateway_api}}

Task

Design an exhaustive parameter validation and error recovery matrix for tool-calling interfaces utilized by automated execution agents trading {{instrument_type}} across {{execution_venue}}.

Method

  1. Define the complete toolset required for trade lifecycle management (quote, validate, submit, modify, cancel, status).
  2. Specify strict JSON schema types, required fields, and boundary ranges for every parameter.
  3. Integrate pre-trade risk validation calls against {{risk_gateway_api}} as mandatory prerequisites for order dispatch.
  4. Embed slippage constraints enforcing the {{max_slippage_bps}} ceiling directly into price calculation functions.
  5. Map exact error codes returned by {{execution_venue}} to automated agent recovery functions.
  6. Align all post-trade reporting payloads with {{settlement_framework}} parameters.
  7. Compile the schema, validation rules, and error recovery steps into a centralized technical matrix.

Constraints

  • MUST reject any tool call parameter that omits strict type enforcement, positive floating bounds, or client order IDs.
  • MUST NOT allow market orders to bypass the {{max_slippage_bps}} validation check.
  • Tool schemas must enforce idempotency keys on all submission and cancellation functions.
  • Pre-trade risk checks via {{risk_gateway_api}} cannot be bypassed by any execution tool.

Output format

1. Interface Specification Summary

A technical summary defining JSON schema compliance and type-checking rules (under 150 words).

2. Parameter Schema & Recovery Matrix

A Markdown table containing the following columns: | Tool Name | Operation Type | Required Schema Parameters | Validation Bounds | API Error Code | Recovery Action | (Define 6 distinct functions: GetQuote, ValidateRisk, SubmitOrder, ModifyOrder, CancelOrder, GetOrderStatus).

3. Circuit Breaker Invariants

A numbered list of 4 non-negotiable failure states that trigger immediate execution shutdown.

Self-review

  • Confirm every function schema includes explicit validation bounds and types.
  • Verify that slippage checks strictly adhere to the {{max_slippage_bps}} threshold.
  • Ensure error handling covers dropped connections and rejection codes from {{execution_venue}}.
AuraScore breakdown
79/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-tool-calling
financial-services
algorithmic-trading
schema-validation
function-calling