Tool & function calling
AuraScore 91/100

Visual Artifact Inspector and Tool Calling Healer Script

Develop an automated visual quality assurance script that evaluates generated images and calls remediation tools when defects are found.

Use this template when setting up closed-loop quality control agents that review AI-generated images for artifacts and automatically invoke restoration tools. It delivers a self-healing evaluation script.

Template

Role: Multimodal Quality Assurance Lead specializing in automated visual evaluation and self-healing agent pipelines.

Context

  • Batch Target Directory: {{asset_batch_directory}}
  • Vision Evaluation Tool: {{vision_evaluator_tool}}
  • Defect Tolerance Score: {{defect_tolerance_threshold}}
  • Remediation Tool Endpoint: {{remediation_tool_endpoint}}
  • Logging Format: {{telemetry_export_format}}

Task

Create an automated evaluation and self-healing script that calls a multimodal vision tool to score generated image quality and conditionally triggers targeted upscaling or face restoration tools.

Method

  1. Scan {{asset_batch_directory}} to discover newly rendered visual assets requiring quality auditing.
  2. Construct and dispatch an evaluation function call to {{vision_evaluator_tool}} for each image asset.
  3. Parse the evaluation response to extract anatomical accuracy, blur metrics, and artifact severity scores.
  4. Compare observed quality scores against the numerical benchmark in {{defect_tolerance_threshold}}.
  5. If defects exceed tolerance, dynamically construct a remediation tool payload targeting {{remediation_tool_endpoint}}.
  6. Dispatch remediation tool calls (e.g., face enhancement, sharpening, denoising) and capture corrected outputs.
  7. Format all evaluation metrics and tool invocation timestamps into {{telemetry_export_format}}.

Constraints

  • MUST prevent infinite remediation loops by enforcing a maximum of two healing passes per asset.
  • MUST NOT overwrite original source files; all healed assets must use distinct version identifiers.
  • MUST validate that evaluation scores fall within the normalized 0.0 to 1.0 range.
  • Keep script dependencies limited to standard HTTP and JSON handling packages.

Output format

1. Inspector and Remediation Script

Executable script executing directory scanning, evaluation tool calls, conditional healing, and file management.

2. Tool Invocation Specs

Structured JSON payloads defining the evaluation and remediation function schemas.

3. Log Sample

Example log entries illustrating a flagged defect, subsequent tool call, and final resolution.

Self-review

  • Verify that the defect threshold check strictly triggers the remediation endpoint.
  • Ensure the loop limit prevents runaway API consumption on corrupted files.
  • Check that output paths preserve the original asset intact.
AuraScore breakdown
91/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 specification14/14 · Strong

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
image-multimodal-prompting
quality-assurance
multimodal
self-healing