> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clawdot.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# errand_update_address

> MCP tool errand_update_address — edit an address in the delivery-errand address book

## errand\_update\_address

Edits an address in the address book. Pass only the fields you want to change — anything omitted keeps its current value. Commonly used to change the door number, the label, or the contact name/phone.

<Warning>
  Changing the **position** requires passing `address`, `lat`, and `lng` together (search with `errand_search_addresses` first to get the new place's coordinates). Changing only the text without the coordinates would send the rider to the old location, so it's rejected.
</Warning>

An empty string is treated as "not passed," except for `tag` — an empty string clears the tag.

### Parameters

| Parameter          | Type   | Required | Default | Description                                                          |
| ------------------ | ------ | -------- | ------- | -------------------------------------------------------------------- |
| `consent_grant_id` | string | Yes      | —       | User consent grant ID (`cg_` prefix), from `errand_verify_user_bind` |
| `address_id`       | string | Yes      | —       | ID of the address to edit (`plat_` prefix)                           |
| `contact_name`     | string | No       | —       | New contact name                                                     |
| `contact_phone`    | string | No       | —       | New contact phone; stored encrypted, always returned masked          |
| `address`          | string | No       | —       | New address text; must be passed together with `lat`/`lng`           |
| `lat`              | number | No       | —       | New latitude (GCJ-02); must be passed together with `address`        |
| `lng`              | number | No       | —       | New longitude (GCJ-02); must be passed together with `address`       |
| `detail`           | string | No       | —       | New door number / extra detail                                       |
| `tag`              | string | No       | —       | New label; pass an empty string to clear it                          |

### Returns

The updated address object; `id` stays unchanged.

| Field                  | Type           | Description                                                                         |
| ---------------------- | -------------- | ----------------------------------------------------------------------------------- |
| `id`                   | string         | Address ID (`plat_` prefix), same as the input `address_id`                         |
| `contact_name`         | string         | Contact name (may be empty)                                                         |
| `contact_phone_masked` | string         | Masked contact phone (e.g. `138****5678`); empty string if no phone was saved       |
| `address`              | string         | Address                                                                             |
| `detail`               | string         | Door number / extra detail (e.g. "Building 3, Room 303"); empty string if never set |
| `lat`                  | number         | Latitude (GCJ-02)                                                                   |
| `lng`                  | number         | Longitude (GCJ-02)                                                                  |
| `tag`                  | string         | Label                                                                               |
| `source`               | string         | Address origin; always `errand` for addresses saved through this capability         |
| `last_used_at`         | string \| null | Last-used timestamp                                                                 |
| `use_count`            | integer        | Number of times used                                                                |

<Note>
  Passing no fields to change returns `ADDRESS_UPDATE_EMPTY`; changing an address to exactly match another one of the user's addresses returns `ADDRESS_DUPLICATE`.
</Note>

### Error Codes

| code                      | Description                                                                                         |
| ------------------------- | --------------------------------------------------------------------------------------------------- |
| `CONSENT_GRANT_REQUIRED`  | Missing consent grant (no `consent_grant_id`)                                                       |
| `CONSENT_GRANT_INVALID`   | Consent grant is invalid                                                                            |
| `CONSENT_GRANT_EXPIRED`   | Consent grant has expired; re-authorization required                                                |
| `CONSENT_GRANT_WRONG_CAP` | Consent grant belongs to a different capability; the delivery-errand capability needs its own grant |
| `CAP_NOT_BOUND`           | The delivery-errand capability is not enabled for this agent                                        |
| `ADDRESS_NOT_FOUND`       | `address_id` does not exist or does not belong to the current user                                  |
| `ADDRESS_COORDS_PAIRED`   | When changing the position, `address` and `lat`/`lng` must be provided together                     |
| `ADDRESS_DUPLICATE`       | The updated address exactly matches another existing address                                        |
| `ADDRESS_UPDATE_EMPTY`    | No field to update was provided                                                                     |
| `ADDRESS_FIELD_TOO_LONG`  | Address / contact / detail / tag / phone exceeds the length limit                                   |

See [Error Handling](/en/gateway/error-handling) for the full list.

### Call Example

```json theme={null}
{
  "name": "errand_update_address",
  "arguments": {
    "consent_grant_id": "<consent_grant_id>",
    "address_id": "plat_12",
    "detail": "3栋502",
    "tag": "家"
  }
}
```
