# edit_queued_message

Source: https://modulify.ai/docs/mcp/chat/edit-queued-message

Rewrites a message that is still waiting in a site's queue, before the site agent picks it up.

- Title: Edit a queued message
- Scope: `chat:write`
- Access: Makes changes

The edit is optimistically concurrent. Read the queue with `list_queued_messages` first and send the entry's `QueueVersion` as `expectedVersion`, and a version that is no longer current is refused rather than quietly overwriting an edit somebody else made in the meantime. On a rejection the tool tells the client to read the queue again, decide whether the change still makes sense against the newer text, and only then retry with the version it just read.

You can only edit a message you queued yourself, and only while it is still queued. Anything you leave out keeps the value the queued message already holds, and `content` is refused over 500,000 characters. A successful edit raises the entry's `QueueVersion` and returns the updated entry in `item`.

Sending `content` as an empty string removes the entry from the queue instead of rewriting it, and the response then says `removed:true`. A message that carries files is kept in the queue even then. See [Message queue](https://modulify.ai/docs/build/message-queue).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id, from `list_sites` or `get_site`. |
| `itemId` | string | Yes | The `Id` of the queued message, exactly as `list_queued_messages` reported it. |
| `expectedVersion` | integer | Yes | The `QueueVersion` that `list_queued_messages` reported for this entry. A stale version is refused, so another person's edit is never silently overwritten. |
| `content` | string | No | The new text of the queued message. An empty string removes the entry from the queue instead of rewriting it. |
| `mode` | string | No | `build`, where the agent makes the change, or `plan`, where it proposes a plan for you to approve first. Leave it out to keep the current mode. |