Editing & rewrite
AuraScore 83/100

Tool Schema Docstring Refactor and Hallucination Reduction Email

Transforms ambiguous tool-calling descriptions into unambiguous JSON schema prompts.

Use this template when an autonomous agent runtime misfires tools due to fuzzy parameter descriptions or token bloat. It produces a structured engineering email detailing rewritten docstrings, routing rules, and benchmark expectations.

Template

Role: Principal AI Interface Architect specializing in deterministic tool selection and LLM semantic disambiguation.

Context

  • Target Runtime: {{target_agent_runtime}}
  • Tool Suite Name: {{tool_suite_name}}
  • Raw Schema Docstrings: {{raw_docstring_payload}}
  • Error & Misfire Telemetry: {{failure_telemetry_summary}}
  • Token Budget Constraint: {{token_budget_limit}}
  • Recipient Team: {{target_recipient_team}}

Task

Draft a technical overhaul email to {{target_recipient_team}} rewriting the schema docstrings for {{tool_suite_name}} to eliminate tool hallucination, improve routing accuracy, and enforce concise parameter typing under {{token_budget_limit}}.

Method

  1. Analyze {{failure_telemetry_summary}} to identify overlapping tool triggers, semantic collisions, and schema ambiguity in {{raw_docstring_payload}}.
  2. Isolate parameter-level descriptions that encourage invalid default values or ambiguous types in {{target_agent_runtime}}.
  3. Rewrite each tool description using affirmative, boundary-explicit language that clarifies exactly when the tool MUST and MUST NOT be called.
  4. Condense all docstrings to fit strictly within {{token_budget_limit}} while preserving edge-case guardrails.
  5. Establish negative constraint clauses inside each definition to distinguish sibling tools in {{tool_suite_name}}.
  6. Formulate synthetic validation cases contrasting the legacy docstring failure against the rewritten schema output.
  7. Package the rewrites into a production-ready engineering email with implementation notes.

Constraints

  • MUST provide line-by-line diffs or side-by-side comparisons of legacy versus rewritten docstrings.
  • MUST NOT alter underlying function parameter names or schema keys.
  • Tone MUST remain authoritative, concise, and focused on systems engineering.
  • Total email length MUST be under 800 words.

Output format

An email composed of the following exact sections:

  • Subject Line: [Action Required] Refactored Tool Definitions for {{tool_suite_name}}
  • Executive Summary (max 3 sentences)
  • Root-Cause Telemetry Breakdown (bulleted)
  • Rewritten Tool Definitions (table or code blocks with Before/After & Token Delta)
  • Edge-Case Routing Guidelines
  • Next Steps & Deployment Validation Checklist

Self-review

  • Are all parameter descriptions deterministic and free of vague qualifiers?
  • Does the total token delta stay below {{token_budget_limit}}?
  • Are the tool-calling boundaries mutually exclusive across the suite?
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.

writing-content
writing-editing
autonomous-agents-workflows
tool-calling
agentic-ai
prompt-refactor