Tool & function calling
AuraScore 83/100

Multimodal Image Synthesis Tool Dispatcher Script

Generate an automated tool-calling dispatch script that converts raw multimodal user requests into structured diffusion tool payloads.

Use this template when designing an agentic middleware layer that parses multimodal prompts and invokes image generation APIs via structured tool calls. It generates executable routing logic with deterministic schema validation.

Template

Role: Lead Multimodal Agent Architect specializing in function-calling pipelines for generative vision models.

Context

  • Target Image Model: {{primary_diffusion_model}}
  • Tool Registry Endpoint: {{tool_registry_path}}
  • Incoming User Prompt Payload: {{user_intent_payload}}
  • Aspect Ratio Constraints: {{aspect_ratio_constraints}}
  • Default Negative Prompt Presets: {{negative_prompt_presets}}
  • Execution Runtime Environment: {{execution_runtime}}

Task

Write a robust tool-calling orchestration script that ingests multimodal user intent, extracts composition parameters, validates arguments against the tool schema, and dispatches the execution payload to the visual generation backend.

Method

  1. Ingest {{user_intent_payload}} and parse implicit visual style, subject matter, and color grading cues.
  2. Cross-reference available visual parameters against {{aspect_ratio_constraints}} to select optimal canvas dimensions.
  3. Map identified attributes directly into the function call schema defined in {{tool_registry_path}}.
  4. Merge required system safeguards and styling defaults from {{negative_prompt_presets}} into the tool payload.
  5. Implement a strict parameter validation step that verifies data types, bounding ranges, and required fields.
  6. Generate the full runtime invocation script targeted for {{execution_runtime}} using standard tool-calling SDK patterns.
  7. Include error-handling branches for schema validation failures, token overflow, and unsupported parameter fallbacks.

Constraints

  • MUST output valid, fully executable code tailored to {{execution_runtime}} without placeholder functions.
  • MUST enforce schema strictness by rejecting unmapped parameters before dispatch.
  • MUST NOT hardcode API credentials directly in the script body.
  • Use explicit typing and defensive input handling across all generated functions.

Output format

1. Function Calling Schema Definition

JSON Schema describing the tool parameters and constraints.

2. Dispatcher Script

Complete executable script containing initialization, payload transformation, validation, and API invocation.

3. Execution Example

Sample input payload and the resulting parsed function call invocation log.

Self-review

  • Confirm every variable from Context is utilized within the script logic.
  • Verify the tool schema strictly matches the constraints of {{primary_diffusion_model}}.
  • Ensure all exception paths produce actionable error objects.
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 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 efficiency7/10 · Adequate

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

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
image-multimodal-prompting
tool-calling
multimodal
diffusion