Tool & function calling
AuraScore 83/100

Financial Fraud Triage Tool Dispatcher Script Generator

Generate a production-ready Python tool-calling script that parses AML fraud alerts and invokes external financial investigation APIs.

Use this template when building an autonomous agent script to triage high-volume anti-money laundering alerts. It creates structured tool definitions and execution handlers for banking risk pipelines.

Template

Role: Principal FinTech Automation Engineer specializing in agentic middleware and banking API integration.

Context

  • Financial Institution: {{institution_name}}
  • Alert Source Engine: {{fraud_detection_engine}}
  • In-Scope Alert Types: {{supported_alert_types}}
  • Agent Framework: {{target_agent_framework}}
  • Dispatch Webhook: {{notification_webhook_endpoint}}
  • Minimum Triage Risk Score: {{risk_threshold_score}}

Task

Author a modular, production-ready execution script that defines LLM tool schemas and handler functions to triage incoming fraud alerts from {{fraud_detection_engine}}, filter by {{risk_threshold_score}}, and trigger downstream investigations across {{institution_name}} systems.

Method

  1. Define typed parameter schemas for {{supported_alert_types}} compatible with {{target_agent_framework}} tool specifications.
  2. Implement a validation function ensuring payload integrity before parsing suspicious transaction metadata.
  3. Construct the core tool function that queries account history and aggregates prior violation counts.
  4. Build an autonomous risk-scoring evaluation handler matching criteria against {{risk_threshold_score}}.
  5. Write a dispatch function forwarding confirmed high-risk payloads to {{notification_webhook_endpoint}}.
  6. Implement deterministic error handling and circuit breaker logic for downstream banking API timeouts.
  7. Wrap the tool pipeline in a runnable CLI entrypoint with structured JSON logging.

Constraints

  • Code MUST be written in idiomatic Python 3.11+ with strict type hints and Pydantic models.
  • MUST NOT expose raw database connection strings, plain-text API keys, or hardcoded secrets.
  • Tool schemas MUST enforce strict parameter validation with detailed docstrings.
  • Script MUST include unit test mock examples at the bottom.

Output format

1. Tool Declaration & Schema

JSON Schema / Pydantic models for agent function calling (under 40 lines).

2. Main Implementation Script

Fully commented Python script with execution pipeline, error boundaries, and webhook dispatching.

3. Usage & Test Example

Terminal execution command and mock invocation payload.

Self-review

  • Confirm all 6 context variables (e.g., {{institution_name}}, {{risk_threshold_score}}) appear and guide code logic.
  • Verify script handles network timeouts and malformed JSON payloads gracefully.
  • Ensure schema conforms strictly to {{target_agent_framework}} requirements.
AuraScore breakdown
83/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 engineering12/12 · Strong

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 efficiency7/10 · Adequate

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
fraud-detection
tool-calling
python