This prompt is designed for agent infrastructure engineers who are orchestrating multiple tool calls in parallel and need a single, coherent, and trustworthy summary for the end user. The core job-to-be-done is to fuse disparate, potentially conflicting structured outputs from APIs, databases, or internal services into one narrative that resolves contradictions, eliminates redundancy, and faithfully cites the origin of each fact. The ideal user is building a production AI system where a user asks one question, the system fans out to several tools, and the raw JSON blobs must be synthesized before they reach the UI.
Prompt
Multi-Tool Result Aggregation and Synthesis Prompt Template

When to Use This Prompt
Defines the job, ideal user, and constraints for the Multi-Tool Result Aggregation and Synthesis prompt.
You should use this prompt when you have two or more tool results that address the same user intent and you need to produce a single, non-redundant answer. It is particularly valuable when the tools may return overlapping or contradictory information—for example, one inventory API showing an item in stock and a shipping API showing it backordered. The prompt template is built to force the model to surface and resolve these conflicts rather than silently picking the first result. It also requires the model to cite which tool provided each claim, making the output auditable. This is not a prompt for simple RAG or single-source summarization; it is for multi-source synthesis where provenance matters.
Do not use this prompt when you are only interpreting a single tool's output, when the tools return completely unrelated data, or when the user needs raw data instead of a summary. It is also the wrong choice if your primary goal is to decide whether to make a follow-up tool call—that requires a separate routing or planning prompt. If your system operates in a regulated domain where every claim must be traceable to a specific record, you must pair this prompt with a post-processing validation harness that checks citation integrity before the response reaches the user. The prompt alone reduces hallucination risk but does not eliminate it; always run eval checks for cross-tool contradiction handling and unattributed claims in production.
Use Case Fit
Where the Multi-Tool Result Aggregation and Synthesis Prompt Template delivers value and where it introduces risk.
Good Fit: Parallel Tool Execution
Use when: multiple independent tools are called simultaneously and their raw outputs must be merged into a single, coherent user-facing summary. Guardrail: ensure each tool result is labeled with its source before aggregation to enable accurate citation.
Good Fit: Conflict Resolution Required
Use when: tool outputs may contradict each other (e.g., different APIs return different statuses). Guardrail: the prompt must instruct the model to surface conflicts explicitly rather than silently picking one result or averaging values.
Bad Fit: Sequential Dependency Chains
Avoid when: the output of Tool A is required as the input for Tool B. This prompt template assumes independent, parallel results. Guardrail: use a sequential orchestration prompt instead, or break the workflow into separate aggregation steps.
Required Input: Labeled Source Blocks
What to watch: the model cannot reliably attribute facts without clear source demarcation. Guardrail: each tool output must be wrapped in an XML tag or markdown section with a unique tool identifier before being passed to the aggregation prompt.
Operational Risk: Context Window Overflow
Risk: multiple large tool outputs can exceed the model's context window, causing silent mid-prompt truncation. Guardrail: implement a pre-prompt token budget check and truncate or summarize individual tool outputs before aggregation if the total exceeds the limit.
Bad Fit: Real-Time Streaming Responses
Avoid when: the system must stream partial results to the user as each tool completes. Aggregation requires all results to be present before synthesis. Guardrail: for streaming use cases, emit per-tool summaries first, then run a final synthesis step once all results are available.
Copy-Ready Prompt Template
A reusable prompt for synthesizing multiple tool outputs into a single coherent, cited, and conflict-aware summary.
This template is designed for agent infrastructure engineers orchestrating parallel tool calls. Its primary job is to consume the raw outputs of multiple tools, resolve any conflicts between them, remove redundant information, and produce a single, coherent summary for the user. Every factual claim in the summary must be explicitly linked back to the specific tool that provided it. Use this prompt when you need a reliable, auditable synthesis step before presenting information to a user or passing it to another agent. Do not use this template if the tool outputs are already in a final user-ready format or if the task is a simple concatenation rather than a true synthesis.
markdownYou are an expert synthesis agent. Your task is to process the outputs of multiple tools, resolve any conflicts, and produce a single, coherent summary for the user. ## TOOL OUTPUTS Below are the results from the tools that were called. Each result is wrapped in an XML tag indicating the tool's name. [TOOL_OUTPUTS] ## USER QUERY The user's original request that triggered these tool calls is provided for context. [USER_QUERY] ## INSTRUCTIONS 1. **Analyze:** Review all tool outputs. Identify the core facts, key data points, and any direct answers to the user's query. 2. **Resolve Conflicts:** If two or more tools provide contradictory information, you must: * Explicitly state the conflict in your response. * Do not arbitrarily choose one source over another. * If possible, suggest a reason for the conflict (e.g., different data freshness, different scopes) and recommend a follow-up action to resolve it. 3. **Remove Redundancy:** If multiple tools report the same fact, mention it only once in the final summary. 4. **Synthesize:** Weave the resolved, non-redundant information into a single, flowing narrative that directly answers the user's query. Structure the response logically, using bullet points or sections if the information is complex. 5. **Cite Meticulously:** Every factual statement in your summary must be followed by a citation tag indicating its source tool. Use the format `[source: tool_name]`. If a statement synthesizes information from multiple tools, list all relevant sources, e.g., `[sources: tool_a, tool_b]`. 6. **Handle Gaps:** If the user's query cannot be fully answered by the provided tool outputs, clearly state what information is missing. Do not invent or infer missing details. ## OUTPUT FORMAT Produce your response in two parts: **Part 1: Synthesis Summary** A direct, comprehensive answer to the user's query, following all instructions above. **Part 2: Processing Notes** A brief, bulleted list of any conflicts found, data gaps identified, or assumptions made during the synthesis process.
To adapt this template, replace the [TOOL_OUTPUTS] placeholder with the raw string outputs from your parallel tool calls. It is critical to wrap each tool's output in a uniquely identifying XML tag (e.g., <tool_a>...</tool_a>) before insertion. The [USER_QUERY] placeholder should contain the exact original user prompt. For high-stakes applications, add a [RISK_LEVEL] placeholder and a corresponding instruction to escalate to a human reviewer if the risk level is 'high' and unresolvable conflicts are detected. You can also add a [CONSTRAINTS] section to enforce rules like 'Do not mention internal tool names to the user' or 'Summarize in under 150 words'.
Before deploying, test this prompt with a golden dataset of multi-tool outputs that includes known conflicts, redundant data, and incomplete answers. Your evaluation should check for citation accuracy, conflict transparency, and hallucination rate. A common failure mode is the model resolving a conflict by silently choosing the data from the first or most authoritative-sounding tool, which defeats the purpose of the audit trail. Another is omitting citations for synthesized or rephrased statements. Implement a post-processing validation step that scans the final summary for any factual claim not immediately followed by a [source: ...] tag, and flag it for review or automatic retry.
Prompt Variables
Placeholders required by the Multi-Tool Result Aggregation and Synthesis prompt. Replace each with concrete values before execution. Validation notes describe how to check that the input is well-formed.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_QUERY] | The original user request that triggered the parallel tool calls | What is the status of order #4521 and when will it ship? | Must be non-empty string. Check for injection patterns if query is used to construct downstream calls. |
[TOOL_RESULTS] | Array of tool call result objects, each containing tool name, output payload, and execution metadata | [{"tool": "order_lookup", "result": {"status": "shipped"}, "duration_ms": 120}] | Must be valid JSON array with at least one element. Each object requires tool, result, and timestamp fields. Null or empty array triggers empty-result handling. |
[OUTPUT_SCHEMA] | Expected JSON schema for the aggregated response, defining required fields and their types | {"type": "object", "properties": {"summary": {"type": "string"}, "sources": {"type": "array"}}, "required": ["summary", "sources"]} | Must be valid JSON Schema draft-07. Parse with ajv or similar validator before prompt assembly. Reject schemas with circular references. |
[CONFLICT_RESOLUTION_POLICY] | Instruction for how to handle contradictory facts across tool outputs | Prefer the most recent timestamp. If timestamps are equal, flag the conflict in the conflicts array and present both values. | Must be non-empty string. Test that policy covers timestamp ties, missing timestamps, and partial overlaps. Policy should not default to silent discard. |
[CITATION_FORMAT] | Template for how each fact should cite its source tool | Source: {tool_name}, Field: {field_path}, Timestamp: {timestamp} | Must include {tool_name} and {field_path} tokens. Validate that format string is parseable and all tokens resolve against actual tool output fields. |
[MAX_SUMMARY_LENGTH] | Token or character limit for the synthesized summary to prevent context overflow | 500 tokens | Must be positive integer. Enforce with tokenizer count post-generation. If exceeded, trigger truncation with completeness flag. |
[REDUNDANCY_THRESHOLD] | Similarity score above which two tool results are considered redundant and merged | 0.85 | Must be float between 0.0 and 1.0. Validate that threshold is applied per-fact, not per-document. Test with identical and near-identical outputs. |
[MISSING_TOOL_FLAG] | Boolean indicating whether any expected tool call failed or timed out, requiring the summary to note gaps | Must be boolean. If true, prompt must include [FAILED_TOOLS] list. If false, validate that no failed-tool references appear in output. |
Implementation Harness Notes
How to wire the multi-tool aggregation prompt into a production application with validation, retries, and audit logging.
This prompt is designed to sit between a tool orchestration layer and the user-facing response. It receives a structured payload containing the original user query and the raw outputs from multiple parallel tool calls. The application is responsible for collecting all tool results, handling timeouts and partial failures, and assembling the input object before invoking the model. Do not pass raw tool outputs directly to the model without first wrapping them in the expected input schema, which should include a tool_call_id, tool_name, status (success, error, timeout, empty), and the raw output for each tool call.
Validation and retry logic should be implemented in the application layer, not in the prompt. After the model returns a synthesized response, validate that every factual claim in the output can be traced to at least one tool result in the input. A lightweight eval harness can check for unattributed claims by extracting all cited tool names from the response and comparing them against the provided tool list. If the model fabricates a tool name or makes a claim without a citation, trigger a retry with a stronger instruction to only use information from the provided tool outputs. Set a maximum of two retries before falling back to a templated message that lists raw tool results without synthesis.
Logging and audit trails are critical for debugging cross-tool contradictions. Store the full input payload, the model's synthesized response, and the validation result in a structured log. Include a contradiction_flag field set by a secondary eval prompt that checks whether the synthesis acknowledges or resolves conflicts between tool outputs. For high-stakes domains, route responses with unresolved contradictions to a human review queue before they reach the end user. Avoid using this prompt for real-time safety-critical decisions without a human-in-the-loop gate.
Expected Output Contract
Define the exact shape of the synthesized response so that downstream parsing, UI rendering, and evaluation harnesses can validate the output reliably.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
synthesis_summary | string | Must be a single paragraph under 300 characters. Must not introduce facts absent from the tool_outputs array. | |
key_findings | array of objects | Array length must be between 1 and 5. Each object must contain finding (string) and source_tool (string matching a tool_id in the input). | |
key_findings[].finding | string | Must be a complete sentence. Must be directly attributable to the corresponding tool output. Null or empty string fails. | |
key_findings[].source_tool | string | Must match exactly one tool_id provided in the [TOOL_OUTPUTS] input block. Unmatched tool_id fails. | |
resolved_conflicts | array of objects or null | If null, no conflicts were detected. If present, each object must contain conflicting_claim_a, conflicting_claim_b, resolution, and resolution_rationale. | |
resolved_conflicts[].resolution | string | true if resolved_conflicts is present | Must be one of: 'preferred_a', 'preferred_b', 'merged', 'escalated'. 'escalated' requires human_review_flag to be true. |
human_review_flag | boolean | Must be true if any conflict resolution is 'escalated', any tool output was marked as low_confidence, or the synthesis relies on a single tool for a critical claim. Otherwise false. | |
follow_up_tool_calls | array of objects or null | If null, no follow-up needed. If present, each object must contain suggested_tool_name (string) and rationale (string). Must not suggest a tool already called in the current turn unless new arguments are provided. |
Common Failure Modes
Multi-tool aggregation fails in predictable ways. These cards cover the most common production failure modes and the guardrails that catch them before users see broken output.
Cross-Tool Contradiction
What to watch: Two tools return conflicting facts (e.g., Tool A reports 'active' status, Tool B reports 'suspended'). The model may silently pick one, blend both into nonsense, or hallucinate a resolution. Guardrail: Add an explicit contradiction-detection step in the prompt that instructs the model to flag conflicts, cite both sources, and refuse to resolve without evidence priority rules.
Silent Tool Output Omission
What to watch: One tool returns an error, empty result, or timeout, and the model synthesizes the response using only the successful tools without acknowledging the gap. The user never knows data is missing. Guardrail: Require the model to enumerate all invoked tools and explicitly mark each as 'used', 'failed', or 'empty' in the synthesis preamble before generating the summary.
Redundancy Without Deduplication
What to watch: Multiple tools return overlapping information, and the model repeats the same fact multiple times in the summary, wasting tokens and confusing the user about whether the repetition signals importance. Guardrail: Instruct the model to deduplicate claims before synthesis, keeping the strongest source citation and noting when multiple tools agree without restating the fact.
Source Attribution Drift
What to watch: The model synthesizes a claim that sounds plausible but attributes it to the wrong tool, or worse, attributes a hallucinated claim to a real tool output. This breaks audit trails and erodes trust. Guardrail: Require inline citations with tool name and field path for every factual claim. Add an eval that extracts all citations and verifies each claim exists in the referenced tool output.
Premature Synthesis Before All Results Arrive
What to watch: In parallel tool-call scenarios, the model begins synthesizing before all tool outputs are available, producing a partial response that reads like a complete answer. This is common when tool latency varies. Guardrail: Enforce a strict 'wait-for-all' instruction in the prompt and add an application-layer check that counts received tool outputs against expected calls before forwarding to the synthesis step.
Tool Output Format Assumption
What to watch: The model assumes a tool output will have a specific structure, field name, or data type based on the tool description rather than inspecting the actual response. When the output shape differs, the model misreads or ignores fields. Guardrail: Instruct the model to inspect the actual structure of each tool output before extraction, and add a schema-validation step in the harness that flags unexpected output shapes before the model processes them.
Evaluation Rubric
Use this rubric to test the quality of synthesized outputs before shipping. Each criterion targets a known failure mode in multi-tool aggregation, including contradiction handling, source attribution, and hallucination.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Cross-Tool Contradiction Handling | Conflicting facts from different tools are explicitly identified and resolved with a reasoned tiebreaker, not silently merged or dropped. | Output presents a single unified claim that ignores a direct contradiction present in the provided tool outputs. | Inject two tool outputs with a known numeric contradiction (e.g., Tool A: revenue=$5M, Tool B: revenue=$5.2M). Assert the output acknowledges the conflict. |
Source Attribution Accuracy | Every factual claim in the summary is linked to the correct originating tool name via inline citation or structured metadata. | A claim is attributed to [Tool A] when the fact only appears in [Tool B]'s output, or a claim has no source citation. | Parse the output for all |
Redundancy Removal | Duplicate information present across multiple tool outputs is consolidated into a single statement, not repeated. | The same fact (e.g., a customer name or status) is stated multiple times in the summary as if it were distinct information. | Provide two tool outputs with overlapping fields. Assert that the final summary contains unique sentences only, measured by semantic similarity threshold. |
Hallucination Prevention | The summary contains zero factual claims that cannot be found verbatim or through direct inference in the provided tool outputs. | The output includes a specific number, date, or entity name not present in any of the input tool outputs. | Extract all atomic claims from the summary. For each claim, run a strict string search and an embedding similarity check against the concatenated tool outputs. Fail if any claim has no match. |
Abstention on Missing Data | When a tool output is empty, null, or missing a requested field, the summary explicitly states that the data is unavailable instead of omitting the topic. | The summary silently ignores a user-requested data point that returned an empty result from the tool. | Provide one tool output with a null field for a key metric. Assert the summary contains a phrase indicating unavailability (e.g., 'not available', 'no data returned'). |
Synthesis Coherence | The summary reads as a single, logically flowing narrative, not a bulleted list of per-tool results pasted together. | The output is structured as 'Tool A says... Tool B says...' without any connective synthesis or overarching conclusion. | Use an LLM judge to rate the output on a 1-5 coherence scale. The prompt must instruct the judge to penalize list-like aggregation without narrative flow. |
Tool Output Fidelity | Numeric values, units, and proper nouns from tool outputs are reproduced exactly without rounding errors, unit conversion, or spelling changes. | A numeric value is rounded (e.g., 1234 becomes 1200) or a unit is dropped (e.g., '100' instead of '100ms') in the summary. | Provide a tool output with a precise value like 'latency: 237.4ms'. Assert the summary string contains '237.4ms' exactly. |
Conflict Resolution Rationale | When a contradiction is resolved, the summary provides a brief, logical reason for preferring one source over another (e.g., recency, authority, precision). | The output states 'Tool A is correct' without any justification, or picks a source arbitrarily. | Inject a timestamp mismatch. Assert the output contains a rationale keyword (e.g., 'because', 'due to', 'since') in the sentence resolving the conflict. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a flat list of tool outputs. Use a simple numbered citation scheme ([Tool 1], [Tool 2]) instead of full source attribution. Skip conflict resolution logic initially—just flag contradictions for manual review. Accept plain-text output instead of enforcing a strict JSON schema.
Prompt snippet
codeYou are given outputs from multiple tools. Summarize the key findings for the user. If two tools disagree, note the disagreement but do not resolve it. Tool Outputs: [TOOL_OUTPUTS] User Question: [USER_QUESTION]
Watch for
- The model blending conflicting facts into a single claim without attribution
- Over-summarization that drops critical details from one tool
- No mechanism to trace which fact came from which tool

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us