---
title: "How do I prevent duplicate actions when retrying an OpenAI tool call?"  
description: "How do I prevent duplicate actions when retrying an OpenAI tool call?"  
author: "Magdalena Michalska"  
published: 2026-10-17  
updated: 2026-10-17  
canonical: https://www.mindstick.com/forum/162536/how-do-i-prevent-duplicate-actions-when-retrying-an-openai-tool-call  
category: "AI Tool Integration"  
tags: ["OpenAI API", "Tool calling", "Backend Reliability"]  
reading_time: 1 minute  

---

# How do I prevent duplicate actions when retrying an OpenAI tool call?

I’m connecting an OpenAI-powered assistant to our booking system. Looking up available appointments is straightforward, but I’m unsure how to handle retries once a tool can actually create a booking.

The awkward case is a timeout: our service submits the booking, the booking system saves it, and the response never reaches us. If we retry the workflow, the assistant might request the same action again.

### Where should duplicate protection live?

- Should our application create an operation ID before asking the model to act?
- Is a tool-call ID suitable for identifying the same booking across retries, or only for matching a particular call and response?
- How should the assistant respond when the action’s outcome is still unknown?

I’m looking for a practical approach to **idempotency keys for tool calls**, especially when a user repeats “yes, book it” after seeing no confirmation. How do you distinguish a retry from an intentional second booking without relying on the model to decide?


---

Original Source: https://www.mindstick.com/forum/162536/how-do-i-prevent-duplicate-actions-when-retrying-an-openai-tool-call

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
