# MCP
Source: https://nordvec.com/docs/guides/mcp#retrying-a-write

## Retrying a write [#retrying-a-write]

`document_push` and `document_push_bulk` take an optional `idempotencyKey`
argument, so an agent or client that retries a push does not index the
documents twice. Send one key per logical write, such as a UUID, and repeat the
same key with the same arguments on every retry:

- the same key with the same arguments within 24 hours returns the first
  call's result without running it again;
- the same key with different arguments is refused: the tool result has
  `isError: true` and names `UNPROCESSABLE_CONTENT`;
- a retry that arrives while the first call is still running is refused the
  same way, naming `CONFLICT`; retry it after a short delay.

A key is 1 to 256 printable ASCII characters and belongs to the API key that
sent it: another API key using the same value runs its own write. A key used
with the REST `Idempotency-Key` header is not shared with the MCP tool, so a
tool call that reuses it is refused with `UNPROCESSABLE_CONTENT`. A call
without the argument runs again every time, which is why these tools do not
declare `idempotentHint`. The REST behaviour is described under
[retrying writes safely](/docs/guides/errors-and-rate-limits).