bymundi API

Change the itinerary

The apply_itinerary_changes MCP tool: change the itinerary.

apply_itinerary_changes · writes · destructive

MCP only (no REST operation).

What the model reads

Applies a list of block operations to one trip's itinerary, all or nothing, with the app's own validation, and re-plans the route of every day it touches. Ops:

data fields by block type — use exactly these names; an unknown field is refused. Rich-text fields accept plain text. catalogRef takes only an id a tool returned (search_catalog, search_places, suggest_routes), as {"kind":"punto","id":"…"}.

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
ops object | object | object | object[] yes max 200 items
confirm string max 300 chars
dryRun boolean Preview only: plan the change and return its effect without writing.

Input schema (JSON)

{
  "type": "object",
  "properties": {
    "tripId": {
      "type": "string",
      "format": "uuid"
    },
    "ops": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "const": "add"
              },
              "type": {
                "type": "string",
                "enum": [
                  "titulo",
                  "texto",
                  "imagen",
                  "agenda",
                  "dia",
                  "caja",
                  "desplegable",
                  "seccion",
                  "capitulo",
                  "derivado",
                  "actividad",
                  "alojamiento",
                  "vuelo",
                  "comida",
                  "transporte",
                  "tren",
                  "crucero",
                  "informacion",
                  "galeria",
                  "video",
                  "mapa",
                  "html",
                  "itinerario"
                ]
              },
              "parentId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The parent: a ref, an id, or the clientId of an earlier add. Absent or null = the root."
              },
              "position": {
                "type": "string",
                "enum": [
                  "start",
                  "end",
                  "after",
                  "before"
                ],
                "description": "\"end\" (default), \"start\", or \"after\"/\"before\" the anchorId sibling."
              },
              "anchorId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "data": {
                "type": "object",
                "additionalProperties": {},
                "description": "Only the fields you set; an update MERGES into the block's data."
              },
              "layout": {
                "type": "object",
                "properties": {
                  "colSpan": {
                    "type": "number",
                    "enum": [
                      1,
                      2,
                      3
                    ]
                  },
                  "hidden": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "clientId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Your name for the new block, so a later op in this call can use it as parentId or anchorId."
              }
            },
            "required": [
              "op",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "const": "update"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "data": {
                "type": "object",
                "additionalProperties": {},
                "description": "Only the fields you set; an update MERGES into the block's data."
              },
              "layout": {
                "type": "object",
                "properties": {
                  "colSpan": {
                    "type": "number",
                    "enum": [
                      1,
                      2,
                      3
                    ]
                  },
                  "hidden": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "expectedVersion": {
                "type": "integer",
                "minimum": 0,
                "description": "Optional: the version you read. Absent = the current one."
              }
            },
            "required": [
              "op",
              "id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "const": "move"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "parentId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "position": {
                "type": "string",
                "enum": [
                  "start",
                  "end",
                  "after",
                  "before"
                ]
              },
              "anchorId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            },
            "required": [
              "op",
              "id",
              "parentId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "const": "delete"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "expectedVersion": {
                "type": "integer",
                "minimum": 0,
                "description": "Optional: the version you read. Absent = the current one."
              }
            },
            "required": [
              "op",
              "id"
            ],
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 200
    },
    "confirm": {
      "type": "string",
      "maxLength": 300
    },
    "dryRun": {
      "type": "boolean",
      "description": "Preview only: plan the change and return its effect without writing."
    }
  },
  "required": [
    "tripId",
    "ops"
  ],
  "additionalProperties": false
}