Portfolio Rebalancing Agent Function Call Matrix
Design parameter schemas, validation rules, and trade-execution tool routing for wealth management agents.
Use this template when setting up algorithmic portfolio management agents that trigger trade execution and rebalancing APIs. It produces an end-to-end function specification matrix ensuring auditability and tax-aware order routing.
Role: Lead Quantitative Automation Engineer designing reliable LLM tool-use schemas for institutional asset management.
Context
- Wealth Management Firm: {{firm_name}}
- Covered Asset Classes: {{asset_classes}}
- Execution API Providers: {{order_execution_apis}}
- Rebalancing Schedule: {{rebalancing_cadence}}
- Tax Policy Constraints: {{tax_optimization_rules}}
- Audit Standard: {{audit_logging_standard}}
Task
Construct a comprehensive function calling schema and parameter validation matrix for an automated wealth advisory agent executing rebalancing logic across {{asset_classes}} at {{firm_name}}.
Method
- Enumerate discrete operational tasks required during the {{rebalancing_cadence}} cycle.
- Map each discrete task to corresponding endpoints in {{order_execution_apis}}.
- Specify JSON-schema-compliant parameter formats for each trade generation and validation function.
- Embed conditional validation logic to enforce {{tax_optimization_rules}} prior to order placement.
- Define response parsing patterns to convert raw broker API payloads into structured state variables.
- Establish idempotency key generation rules to eliminate duplicate order submission risks.
- Detail compliance verification hooks aligned with {{audit_logging_standard}} for each tool invocation.
Constraints
- MUST format the core deliverable as a multi-column comparison matrix covering tool schemas.
- MUST NOT allow any order execution function to run without a validated idempotency token.
- All numerical fields (weights, share quantities, currency amounts) MUST specify precision constraints.
- Error handling specifications MUST define human escalation triggers for failed executions.
Output format
1. Execution Pipeline Summary
A brief summary (under 120 words) outlining tool orchestration flow for {{firm_name}}.
2. Tool Calling Specification Matrix
A Markdown matrix with columns: Function Name, Target API (from {{order_execution_apis}}), Asset Class Scope (from {{asset_classes}}), Required Parameters & Types, Validation Rules, and Idempotency Strategy.
3. Exception & Tax Rule Matrix
A secondary matrix mapping exception scenarios against {{tax_optimization_rules}} and required log outputs under {{audit_logging_standard}}.
Self-review
- Verify every asset class listed in {{asset_classes}} has explicit representation in the matrix.
- Check that each function schema strictly enforces {{tax_optimization_rules}} before execution.
- Ensure compliance traceability aligns with {{audit_logging_standard}} across all tool states.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.