# Update a trip

> The update_trip MCP tool: update a trip.

`update_trip` · writes

[REST: `PATCH /v1/trips/{tripId}`](https://api.bymundi.com/docs/reference/trips.update.md)

## What the model reads

Changes any field an agent can edit in the app: title, startDate, endDate, travelers (1–40; refused while a quote is accepted), ownerId (an active staff member), design, presentation, profile and metadata. An absent field is unchanged and `null` clears it. `presentation` and `profile` are replaced as a whole; `metadata` merges key by key, and `"key": null` deletes that key. Changing the dates re-dates the itinerary, as the app does. Changing `design` does NOT rebuild the itinerary's days: call sync_itinerary afterwards.

Permissions: trips:write.
Set `dryRun: true` to preview the effect without writing anything.
Undo: the result names a change id; undo_change reverts it.

## Input

| Field | Type | Required | Description |
|---|---|---|---|
| `tripId` | uuid | yes |  |
| `title` | string |  |  |
| `startDate` | string \| null |  |  |
| `endDate` | string \| null |  |  |
| `travelers` | integer |  | 1–40 |
| `ownerId` | uuid \| null |  |  |
| `design` | object \| null |  |  |
| `design.version` | 1 | yes |  |
| `design.originCity` | string | yes |  |
| `design.stops` | object[] | yes | max 60 items |
| `design.stops[].id` | string | yes |  |
| `design.stops[].city` | string | yes |  |
| `design.stops[].nights` | integer | yes | 0–365 |
| `design.stops[].transferBefore` | object \| null | yes |  |
| `design.stops[].escala` | boolean |  | default false |
| `design.stops[].place` | object |  | default {"placeId":"","lat":null,"lng":null,"formattedAddress":""} |
| `design.returnCity` | string \| null | yes |  |
| `design.returnTransfer` | object \| null | yes |  |
| `design.returnTransfer.id` | string | yes |  |
| `design.returnTransfer.departDate` | string \| null | yes |  |
| `design.returnTransfer.arriveDate` | string \| null | yes |  |
| `design.returnTransfer.days` | integer |  | 0–30, default 0 |
| `design.returnTransfer.departTime` | string |  | default "" |
| `design.returnTransfer.arriveTime` | string |  | default "" |
| `design.returnTransfer.flight` | object |  | default {"flightNo":"","airline":"","fromAirport":"","toAirport":"","source":"","fetchedAt":"","scheduleValidFor":""} |
| `design.originPlace` | object |  | default {"placeId":"","lat":null,"lng":null,"formattedAddress":""} |
| `design.originPlace.placeId` | string |  | default "" |
| `design.originPlace.lat` | number \| null |  | default null |
| `design.originPlace.lng` | number \| null |  | default null |
| `design.originPlace.formattedAddress` | string |  | default "" |
| `design.returnPlace` | object |  | default {"placeId":"","lat":null,"lng":null,"formattedAddress":""} |
| `design.returnPlace.placeId` | string |  | default "" |
| `design.returnPlace.lat` | number \| null |  | default null |
| `design.returnPlace.lng` | number \| null |  | default null |
| `design.returnPlace.formattedAddress` | string |  | default "" |
| `presentation` | object \| null |  |  |
| `presentation.logoUrl` | uri \| null |  |  |
| `presentation.brandColor` | string \| null |  |  |
| `presentation.fontFamily` | "inter" \| "montserrat" \| "poppins" \| "lora" \| "playfair" \| "source-sans" \| null |  |  |
| `presentation.headerMedia` | object \| null |  |  |
| `presentation.headerMedia.type` | "image" \| "video" | yes |  |
| `presentation.headerMedia.url` | uri | yes |  |
| `profile` | object \| null |  |  |
| `profile.pace` | "relajado" \| "equilibrado" \| "intenso" \| null |  |  |
| `profile.profiles` | "primera_vez" \| "repetidor" \| "familia_ninos" \| "pareja" \| "grupo" \| "senior" \| "movilidad_reducida" \| "cultural" \| "gastronomico" \| "naturaleza" \| "fotografia" \| "otaku" \| "compras" \| "presupuesto_ajustado" \| "premium"[] |  |  |
| `profile.mobility` | "normal" \| "reducida" |  |  |
| `profile.avoid` | string[] |  |  |
| `profile.notes` | string |  |  |
| `metadata` | object |  |  |
| `dryRun` | boolean |  | Preview only: plan the change and return its effect without writing. |

## Input schema (JSON)

```json
{
  "type": "object",
  "properties": {
    "tripId": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "startDate": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "endDate": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "travelers": {
      "type": "integer",
      "minimum": 1,
      "maximum": 40
    },
    "ownerId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "design": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "version": {
              "type": "number",
              "const": 1
            },
            "originCity": {
              "type": "string"
            },
            "stops": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "nights": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 365
                  },
                  "transferBefore": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "departDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "arriveDate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "days": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 30,
                            "default": 0
                          },
                          "departTime": {
                            "type": "string",
                            "default": ""
                          },
                          "arriveTime": {
                            "type": "string",
                            "default": ""
                          },
                          "flight": {
                            "type": "object",
                            "properties": {
                              "flightNo": {
                                "type": "string",
                                "default": ""
                              },
                              "airline": {
                                "type": "string",
                                "default": ""
                              },
                              "fromAirport": {
                                "type": "string",
                                "default": ""
                              },
                              "toAirport": {
                                "type": "string",
                                "default": ""
                              },
                              "source": {
                                "type": "string",
                                "default": ""
                              },
                              "fetchedAt": {
                                "type": "string",
                                "default": ""
                              },
                              "scheduleValidFor": {
                                "type": "string",
                                "default": ""
                              }
                            },
                            "additionalProperties": false,
                            "default": {
                              "flightNo": "",
                              "airline": "",
                              "fromAirport": "",
                              "toAirport": "",
                              "source": "",
                              "fetchedAt": "",
                              "scheduleValidFor": ""
                            }
                          }
                        },
                        "required": [
                          "id",
                          "departDate",
                          "arriveDate"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "escala": {
                    "type": "boolean",
                    "default": false
                  },
                  "place": {
                    "type": "object",
                    "properties": {
                      "placeId": {
                        "type": "string",
                        "default": ""
                      },
                      "lat": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "default": null
                      },
                      "lng": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "default": null
                      },
                      "formattedAddress": {
                        "type": "string",
                        "default": ""
                      }
                    },
                    "additionalProperties": false,
                    "default": {
                      "placeId": "",
                      "lat": null,
                      "lng": null,
                      "formattedAddress": ""
                    }
                  }
                },
                "required": [
                  "id",
                  "city",
                  "nights",
                  "transferBefore"
                ],
                "additionalProperties": false
              },
              "maxItems": 60
            },
            "returnCity": {
              "type": [
                "string",
                "null"
              ]
            },
            "returnTransfer": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "departDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "arriveDate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "days": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 30,
                      "default": 0
                    },
                    "departTime": {
                      "type": "string",
                      "default": ""
                    },
                    "arriveTime": {
                      "type": "string",
                      "default": ""
                    },
                    "flight": {
                      "type": "object",
                      "properties": {
                        "flightNo": {
                          "type": "string",
                          "default": ""
                        },
                        "airline": {
                          "type": "string",
                          "default": ""
                        },
                        "fromAirport": {
                          "type": "string",
                          "default": ""
                        },
                        "toAirport": {
                          "type": "string",
                          "default": ""
                        },
                        "source": {
                          "type": "string",
                          "default": ""
                        },
                        "fetchedAt": {
                          "type": "string",
                          "default": ""
                        },
                        "scheduleValidFor": {
                          "type": "string",
                          "default": ""
                        }
                      },
                      "additionalProperties": false,
                      "default": {
                        "flightNo": "",
                        "airline": "",
                        "fromAirport": "",
                        "toAirport": "",
                        "source": "",
                        "fetchedAt": "",
                        "scheduleValidFor": ""
                      }
                    }
                  },
                  "required": [
                    "id",
                    "departDate",
                    "arriveDate"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "originPlace": {
              "type": "object",
              "properties": {
                "placeId": {
                  "type": "string",
                  "default": ""
                },
                "lat": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null
                },
                "lng": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null
                },
                "formattedAddress": {
                  "type": "string",
                  "default": ""
                }
              },
              "additionalProperties": false,
              "default": {
                "placeId": "",
                "lat": null,
                "lng": null,
                "formattedAddress": ""
              }
            },
            "returnPlace": {
              "type": "object",
              "properties": {
                "placeId": {
                  "type": "string",
                  "default": ""
                },
                "lat": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null
                },
                "lng": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null
                },
                "formattedAddress": {
                  "type": "string",
                  "default": ""
                }
              },
              "additionalProperties": false,
              "default": {
                "placeId": "",
                "lat": null,
                "lng": null,
                "formattedAddress": ""
              }
            }
          },
          "required": [
            "version",
            "originCity",
            "stops",
            "returnCity",
            "returnTransfer"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "presentation": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "logoUrl": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uri"
                },
                {
                  "type": "null"
                }
              ]
            },
            "brandColor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "fontFamily": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "inter",
                    "montserrat",
                    "poppins",
                    "lora",
                    "playfair",
                    "source-sans"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "headerMedia": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "image",
                        "video"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "type",
                    "url"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "profile": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "pace": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "relajado",
                    "equilibrado",
                    "intenso"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "profiles": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "primera_vez",
                  "repetidor",
                  "familia_ninos",
                  "pareja",
                  "grupo",
                  "senior",
                  "movilidad_reducida",
                  "cultural",
                  "gastronomico",
                  "naturaleza",
                  "fotografia",
                  "otaku",
                  "compras",
                  "presupuesto_ajustado",
                  "premium"
                ]
              }
            },
            "mobility": {
              "type": "string",
              "enum": [
                "normal",
                "reducida"
              ]
            },
            "avoid": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "notes": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 500
          },
          {
            "type": "null"
          }
        ]
      },
      "propertyNames": {
        "pattern": "^[A-Za-z0-9_.-]{1,40}$"
      }
    },
    "dryRun": {
      "type": "boolean",
      "description": "Preview only: plan the change and return its effect without writing."
    }
  },
  "required": [
    "tripId"
  ],
  "additionalProperties": false
}
```
