[
  {
    "name": "bookrail_docs_search",
    "title": "Search the Bookrail documentation",
    "description": "Searches the Bookrail documentation packaged with this server and returns the matching pages, ranked, each with the lines that matched.\nUse it whenever you are about to guess: how availability is computed, what a config field means, what an error code means, how holds and bookings relate.\nReturns: `{ query, hits: [{ topic, title, url, score, excerpts }] }`.\nNext: `bookrail_docs_get` with the `topic` of the best hit, for the whole page.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "minLength": 2,
          "description": "Words to look for, e.g. \"daylight saving\" or \"idempotency\"."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "default": 5,
          "description": "How many pages to return."
        }
      },
      "required": [
        "query"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Search the Bookrail documentation",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_docs_get",
    "title": "Read one documentation page",
    "description": "Returns one page of the Bookrail documentation as markdown, offline. With no `path`, lists the pages available.\nUse it after `bookrail_docs_search`, or directly when you know the page: `getting-started`, `config`, `entities`, `api`, `errors`, `timezones`, `agents`.\nReturns: `{ topic, title, markdown, url }`, or `{ topics: [...] }` when `path` is omitted.\nNext: `bookrail_schema` for the exact shape of the configuration, then `bookrail_config_validate`.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "The page name, e.g. \"config\". Omit to list every page. A prefix is enough."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read one documentation page",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_schema",
    "title": "JSON Schema of the configuration or of one entity",
    "description": "Returns the JSON Schema of `bookrail.config.ts`, or of one of its collections, generated from the same Zod schemas that validate a push, so a config written against it cannot be refused for a field that does not exist.\nUse it before writing or editing a configuration, and whenever `bookrail_config_validate` reported a field you do not recognise.\nEntities: config, locations, schedules, resources, resourceGroups, policies, services.\nReturns: the JSON Schema object, or `{ schemas: [...] }` when `entity` is omitted.\nNext: `bookrail_config_validate`, then `bookrail_config_push` with dry_run: true.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "entity": {
          "type": "string",
          "enum": [
            "config",
            "locations",
            "schedules",
            "resources",
            "resourceGroups",
            "policies",
            "services"
          ],
          "description": "Which schema. Omit to list them."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "JSON Schema of the configuration or of one entity",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_examples",
    "title": "A complete working model of a vertical",
    "description": "Returns a complete, valid `bookrail.config.ts` for one vertical, plus the calls that follow it in order.\nUse it as the starting point for modelling a business: pick the closest vertical, then edit it. It is faster and safer than writing a configuration from the schema alone.\nVerticals: salon, padel, gym, rental, restaurant, clinic, coworking, tours, tutoring, empty.\nReturns: `{ vertical, summary, config, config_file, calls }`. `config` is the object to pass to `bookrail_config_push`.\nNext: `bookrail_config_validate` with your edited config, then `bookrail_config_push` with dry_run: true.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "vertical": {
          "type": "string",
          "enum": [
            "salon",
            "padel",
            "gym",
            "rental",
            "restaurant",
            "clinic",
            "coworking",
            "tours",
            "tutoring",
            "empty"
          ],
          "description": "Which vertical. Omit to list them with one line each."
        },
        "framework": {
          "type": "string",
          "description": "nextjs, nuxt, sveltekit, expo, ts or node to get the calls in TypeScript instead of curl."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "A complete working model of a vertical",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_edge_cases",
    "title": "The edge cases Bookrail already handles",
    "description": "Returns the list of booking edge cases Bookrail handles, with how it handles each: simultaneous requests for the last seat, holds expiring mid-flow, schedule changes that orphan a booking, capacity reductions, overlapping buffers, bookings across midnight and across a clock change, splits across a group, blocks, pricing rules on a band that wraps midnight or on an hour that does not exist, and the pitfalls of driving the API.\nUse it before building anything yourself: most of what looks like \"a special case in my business\" is already a tested case here.\nTopics: concurrency, daylight-saving, schedules, pricing, pitfalls, errors. Omit to get them all.\nReturns: `{ topics: [{ topic, title, source_page, markdown }] }`.\nNext: `bookrail_docs_get` for the whole page a topic came from.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "topic": {
          "type": "string",
          "enum": [
            "concurrency",
            "daylight-saving",
            "schedules",
            "pricing",
            "pitfalls",
            "errors"
          ],
          "description": "Narrow to one topic. Omit for all of them."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "The edge cases Bookrail already handles",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_project_info",
    "title": "Which project, key and API this server is talking to",
    "description": "Returns the project the configured key belongs to, the API URL and version, the key (masked) and where it came from, and whether the live environment is reachable from this server at all.\nUse it first, before any other call that touches data: it proves the key works and names the project you are about to change.\nReturns: `{ environment, project: { id, name, default_timezone, default_currency }, api_key: { id, scopes, tenant_id }, api_url, api_version_served, live_allowed }`.\nNext: `bookrail_doctor` if anything looks wrong; `bookrail_config_pull` to see what the project already contains.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Which project, key and API this server is talking to",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_doctor",
    "title": "Check the environment and say how to fix it",
    "description": "Runs every check the `bookrail doctor` command runs (Node version, credentials and their file permissions, environment against key prefix, API reachability, API version drift, authentication, project and project environment, configuration file validity) and returns each as ok / warn / fail with a `fix` sentence.\nUse it when a call failed and you do not know why, or before starting work in a new project directory.\nReturns: `{ checks: [{ name, status, message, fix? }], summary: { ok, warn, fail } }`. `ok: false` is never returned for a failed check: read `summary.fail`.\nNext: act on the `fix` of every failing check, then call `bookrail_project_info`.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "config_path": {
          "type": "string",
          "description": "Path to the configuration file to validate. Default: bookrail.config.* in the project directory."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Check the environment and say how to fix it",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_config_validate",
    "title": "Validate a Bookrail configuration",
    "description": "Validates a configuration (locations, schedules, resources, resource groups, policies, services) against the same schema a push validates with, and cross-checks every logical reference (a service pointing at a group that the file does not declare, a resource pointing at a missing schedule).\nUse it after writing or editing a configuration and before every push. It touches no network and needs no key.\nReturns: `{ valid, issues: [{ path, message }], counts }`. `path` is the position inside the configuration, e.g. `services[1].requirements[0].group`.\nNext: `bookrail_config_push` with dry_run: true.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "config": {
          "type": "object",
          "additionalProperties": {},
          "description": "The configuration as an object, the same shape as bookrail.config.ts (call bookrail_schema with entity \"config\"). Omit to use the file in the project directory."
        },
        "config_path": {
          "type": "string",
          "description": "Path to a configuration file to use instead of the one in the project directory."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Validate a Bookrail configuration",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": false
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_config_push",
    "title": "Apply a configuration to the project",
    "description": "Reconciles a configuration with the project: creates what is missing, updates what differs, deletes what the configuration no longer declares. Objects with no `metadata.config_id` were not created from a configuration and are never touched: they come back in `unmanaged`.\nUse it after `bookrail_config_validate`. Call it first with `dry_run: true` (the default) to read the plan; then with `dry_run: false` and `confirm: true` to apply.\nSafety: `dry_run: false` requires `confirm: true`, and so does any plan that contains a deletion. Without it the tool returns the plan and `requires_confirmation: true` and changes nothing.\nReturns: `{ plan: [{ action, kind, config_id, remote_id, name, changes }], counts, unmanaged, applied }`.\nNext: `bookrail_objects_list` with kind \"services\" to read back the `svc_` ids, then `bookrail_availability`.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "config": {
          "type": "object",
          "additionalProperties": {},
          "description": "The configuration as an object, the same shape as bookrail.config.ts (call bookrail_schema with entity \"config\"). Omit to use the file in the project directory."
        },
        "config_path": {
          "type": "string",
          "description": "Path to a configuration file to use instead of the one in the project directory."
        },
        "dry_run": {
          "type": "boolean",
          "default": true,
          "description": "True (the default) computes the plan and writes nothing."
        },
        "confirm": {
          "type": "boolean",
          "default": false,
          "description": "Must be true to actually perform this irreversible operation. With false (the default) the tool returns a preview and requires_confirmation: true, and changes nothing."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Apply a configuration to the project",
      "readOnlyHint": false,
      "destructiveHint": true,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_config_pull",
    "title": "Read the project back as a configuration",
    "description": "Returns the project as a configuration object, in the shape `bookrail.config.ts` declares. Read-only: nothing is written, on the project or on disk.\nUse it to discover what a project already contains before changing anything, or to start a configuration from a project that was built through the API.\nReturns: `{ config, written: null, stamped: [], adopted }`. `adopted` lists objects with no `metadata.config_id`: pushing this configuration would create copies of them, so take them over with the CLI (`bookrail pull --adopt`) before pushing.\nNext: `bookrail_config_validate` on the returned `config`, then `bookrail_config_push` with dry_run: true.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read the project back as a configuration",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_availability",
    "title": "What is bookable in a window",
    "description": "Returns every bookable instant for a service between two instants, with duration, remaining capacity, price and the resource combinations that could serve it.\nUse it before creating a hold or a booking. With `explain: true` it also returns, for every candidate instant that is NOT bookable, the structured reasons why, which is the fastest way to understand a model that is not doing what you expect.\nWindow: at most 90 days, 7 with `explain`.\nReturns: `{ service_id, timezone, granularity, slots: [{ start, end, duration_minutes, available_capacity, price, price_rule, resource_options }], next_available, explain? }`. Instants out are UTC.\n`price` is the price of that slot, not necessarily the flat price of the service: if the service carries `pricing_rules`, the first rule whose `when` matches decides, and `price_rule` is `{ index, label }` naming it, or null when the flat price applied. It is the price the booking will freeze.\nNext: `bookrail_hold_create` to take the capacity for a few minutes, or `bookrail_booking_create` to book directly.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "service_id": {
          "type": "string",
          "description": "The service id (`svc_...`). Get it from bookrail_objects_list with kind \"services\"."
        },
        "from": {
          "type": "string",
          "description": "Start of the window as an ISO 8601 instant with an explicit offset, e.g. \"2026-09-08T07:00:00Z\" or \"2026-09-08T09:00:00+02:00\". A bare date is refused: midnight is not the same instant in every time zone."
        },
        "to": {
          "type": "string",
          "description": "End of the window as an ISO 8601 instant with an explicit offset, e.g. \"2026-09-08T07:00:00Z\" or \"2026-09-08T09:00:00+02:00\". A bare date is refused: midnight is not the same instant in every time zone."
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "description": "How many units, e.g. seats. Default 1."
        },
        "timezone": {
          "type": "string",
          "description": "IANA zone for the presented times, e.g. \"Europe/Rome\"."
        },
        "resource_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Restrict to these resource ids (`res_...`). Omit to let the group allocate."
        },
        "customer_id": {
          "type": "string",
          "description": "Apply this customer's entitlements and limits."
        },
        "granularity": {
          "type": "string",
          "enum": [
            "slots",
            "ranges"
          ],
          "description": "\"slots\" (default) for discrete starts, \"ranges\" for continuous bookable intervals."
        },
        "explain": {
          "type": "boolean",
          "default": false,
          "description": "Also return why each rejected instant was rejected. Limits the window to 7 days."
        }
      },
      "required": [
        "service_id",
        "from",
        "to"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "What is bookable in a window",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_availability_next",
    "title": "The first bookable instant",
    "description": "Returns the first instant a service can be booked at, searched in 30-day windows up to 90 days ahead.\nUse it when you need *an* instant rather than a window: a smoke test after a push, or the default a user is offered.\nReturns: `{ next_available, slot, searched_through, timezone }`. `next_available` is null when nothing is bookable in 90 days.\nNext: `bookrail_availability_check` on that instant, then `bookrail_hold_create` or `bookrail_booking_create`.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "service_id": {
          "type": "string",
          "description": "The service id (`svc_...`). Get it from bookrail_objects_list with kind \"services\"."
        },
        "from": {
          "type": "string",
          "description": "Where to start searching as an ISO 8601 instant with an explicit offset, e.g. \"2026-09-08T07:00:00Z\" or \"2026-09-08T09:00:00+02:00\". A bare date is refused: midnight is not the same instant in every time zone."
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "description": "How many units. Default 1."
        },
        "timezone": {
          "type": "string",
          "description": "IANA zone for the presented times."
        }
      },
      "required": [
        "service_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "The first bookable instant",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_availability_check",
    "title": "Is this exact instant bookable",
    "description": "Answers whether one precise instant is bookable, and when it is not, returns the structured reasons.\nUse it right before booking an instant you got from somewhere else (a UI, a cache, a user), and to close the loop after a configuration change.\nReturns: `{ available, available_capacity, price, resource_options, reasons? }`.\nNext: `bookrail_hold_create` if available; `bookrail_explain_unavailable` or `bookrail_availability` with explain: true if not.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "service_id": {
          "type": "string",
          "description": "The service id (`svc_...`). Get it from bookrail_objects_list with kind \"services\"."
        },
        "start": {
          "type": "string",
          "description": "The instant to check as an ISO 8601 instant with an explicit offset, e.g. \"2026-09-08T07:00:00Z\" or \"2026-09-08T09:00:00+02:00\". A bare date is refused: midnight is not the same instant in every time zone."
        },
        "duration_minutes": {
          "type": "integer",
          "minimum": 1,
          "description": "Required when the service offers several durations."
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "description": "How many units. Default 1."
        },
        "resource_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Restrict to these resource ids (`res_...`). Omit to let the group allocate."
        }
      },
      "required": [
        "service_id",
        "start"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Is this exact instant bookable",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_explain_unavailable",
    "title": "Why is this instant not bookable",
    "description": "The \"why not\" of the availability engine for one instant: closed schedule, block, existing occupancy, buffer, booking window, grid alignment, capacity, policy. Each one comes back as a code, a message and, where it applies, the resource it came from.\nUse it whenever an instant you expected to be bookable is not. It is the same computation `bookrail_availability_check` reports and the same one `explain: true` reports over a window, narrowed to one instant so the answer is short.\nReturns: `{ available, reasons: [{ code, message, resource_id? }] }`.\nNext: fix the model (`bookrail_config_push`) or pick another instant (`bookrail_availability_next`).",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "service_id": {
          "type": "string",
          "description": "The service id (`svc_...`). Get it from bookrail_objects_list with kind \"services\"."
        },
        "start": {
          "type": "string",
          "description": "The instant that is not bookable as an ISO 8601 instant with an explicit offset, e.g. \"2026-09-08T07:00:00Z\" or \"2026-09-08T09:00:00+02:00\". A bare date is refused: midnight is not the same instant in every time zone."
        },
        "duration_minutes": {
          "type": "integer",
          "minimum": 1,
          "description": "The duration you intended."
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "description": "How many units. Default 1."
        }
      },
      "required": [
        "service_id",
        "start"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Why is this instant not bookable",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_hold_create",
    "title": "Hold capacity for a few minutes",
    "description": "Takes the capacity for an instant and keeps it for the policy's hold duration (ten minutes by default), so you can collect a payment or a confirmation without racing anyone else.\nUse it in any flow where something happens between choosing a slot and committing to it. Skip it and call `bookrail_booking_create` directly when nothing happens in between.\nReturns: `{ id, status, start, end, expires_at, quantity, price, allocations }`.\nNext: `bookrail_booking_create` with `hold_id` to convert it, or `bookrail_hold_release` to give it back.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "service_id": {
          "type": "string",
          "description": "The service id (`svc_...`)."
        },
        "start": {
          "type": "string",
          "description": "ISO 8601 instant with an explicit offset."
        },
        "duration_minutes": {
          "type": "integer",
          "minimum": 1,
          "description": "Required when the service offers several durations."
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "description": "How many units. Default 1."
        },
        "resource_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pin specific resources."
        },
        "ttl": {
          "type": "string",
          "description": "How long to hold it, e.g. \"10m\". Default: the policy."
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Your own key/value pairs."
        },
        "customer_id": {
          "type": "string",
          "description": "An existing customer (`cus_...`). Mutually exclusive with the customer_* fields."
        },
        "customer_email": {
          "type": "string",
          "description": "Creates or finds a customer by email."
        },
        "customer_name": {
          "type": "string",
          "description": "Only with customer_email / phone / external_id."
        },
        "customer_phone": {
          "type": "string",
          "description": "Creates or finds a customer by phone."
        },
        "customer_external_id": {
          "type": "string",
          "description": "Your own identifier for the customer."
        }
      },
      "required": [
        "service_id",
        "start"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Hold capacity for a few minutes",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_hold_get",
    "title": "Read one hold",
    "description": "Returns one hold and, above all, its status: `active` (still convertible), `released`, `expired`, or `converted`, with `booking_id` when it became a booking.\nUse it when a flow was interrupted and you do not know whether the hold you took is still yours, and before retrying a conversion that failed: a hold that is `expired` will never convert, and the answer is to take a new one.\nReturns: `{ id, status, service_id, start, end, expires_at, booking_id, allocations }`. `price` is null on a read: a hold has no stored price, only a booking freezes one.\nNext: `bookrail_booking_create` with `hold_id` while it is active; `bookrail_availability` once it is not.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "hold_id": {
          "type": "string",
          "description": "The hold id (`hold_...`)."
        }
      },
      "required": [
        "hold_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read one hold",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_hold_release",
    "title": "Give a hold back",
    "description": "Releases a hold and frees the capacity immediately, instead of waiting for it to expire.\nUse it as soon as a flow is abandoned. It needs no confirmation: `DELETE /v1/holds/{id}` is idempotent and releasing is the intended end of a hold's life. A hold already converted into a booking answers 409 `hold_not_active`.\nReturns: `{ id, deleted: true }`.\nNext: nothing. Releasing twice is a success, not an error.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "hold_id": {
          "type": "string",
          "description": "The hold id (`hold_...`)."
        }
      },
      "required": [
        "hold_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Give a hold back",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_booking_create",
    "title": "Create a booking",
    "description": "Creates a booking, optionally by converting a hold. The capacity is taken inside one database transaction, so two simultaneous requests for the last seat cannot both succeed: the loser gets `slot_unavailable` (409).\nUse it after `bookrail_availability` or `bookrail_availability_check`. Pass `hold_id` when you held the slot first: converting a hold cannot fail for capacity.\nReturns: the booking `{ id, status, start, end, price, allocations, next_transition }`.\nNext: `bookrail_booking_get` to close the loop; `bookrail_booking_confirm` when the status is \"pending\".",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "service_id": {
          "type": "string",
          "description": "The service id (`svc_...`)."
        },
        "start": {
          "type": "string",
          "description": "ISO 8601 instant with an explicit offset."
        },
        "duration_minutes": {
          "type": "integer",
          "minimum": 1,
          "description": "Required when the service offers several durations."
        },
        "quantity": {
          "type": "integer",
          "minimum": 1,
          "description": "How many units. Default 1."
        },
        "hold_id": {
          "type": "string",
          "description": "Convert this hold instead of taking new capacity."
        },
        "resource_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pin specific resources."
        },
        "notes": {
          "type": "string",
          "description": "Free text kept on the booking."
        },
        "source": {
          "type": "string",
          "enum": [
            "api",
            "widget",
            "portal",
            "import"
          ],
          "description": "Where the booking came from. Default \"api\"."
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Your own key/value pairs."
        },
        "customer_id": {
          "type": "string",
          "description": "An existing customer (`cus_...`). Mutually exclusive with the customer_* fields."
        },
        "customer_email": {
          "type": "string",
          "description": "Creates or finds a customer by email."
        },
        "customer_name": {
          "type": "string",
          "description": "Only with customer_email / phone / external_id."
        },
        "customer_phone": {
          "type": "string",
          "description": "Creates or finds a customer by phone."
        },
        "customer_external_id": {
          "type": "string",
          "description": "Your own identifier for the customer."
        }
      },
      "required": [
        "service_id",
        "start"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Create a booking",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_booking_get",
    "title": "Read one booking",
    "description": "Returns one booking with its status, times, price, refund expectation, allocations and the transition scheduled for it.\nUse it after every write, to close the loop on what actually happened.\nReturns: the booking object.\nNext: the transition the `next_transition` field names, or `bookrail_booking_cancel`.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "booking_id": {
          "type": "string",
          "description": "The booking id (`bk_...`)."
        },
        "expand": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "customer",
              "allocations.resource"
            ]
          },
          "description": "Include the linked objects inline instead of just their ids."
        }
      },
      "required": [
        "booking_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read one booking",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_booking_list",
    "title": "List bookings",
    "description": "Lists bookings, filtered by customer, service, resource, status or time window, with cursor pagination.\nUse it to answer \"what is on the calendar\" and to find a booking whose id you do not have.\nReturns: `{ data: [...], has_more, next_cursor }`. Pass `next_cursor` back as `starting_after` for the next page.\nNext: `bookrail_booking_get` on one of them.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "customer_id": {
          "type": "string"
        },
        "service_id": {
          "type": "string"
        },
        "resource_id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "description": "pending, confirmed, in_progress, completed, cancelled, no_show, rescheduled."
        },
        "from": {
          "type": "string",
          "description": "ISO 8601 instant with an offset."
        },
        "to": {
          "type": "string",
          "description": "ISO 8601 instant with an offset."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Default 20, at most 100."
        },
        "starting_after": {
          "type": "string",
          "description": "Cursor: the id of the last row you saw."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "List bookings",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_booking_transition",
    "title": "Move a booking forward",
    "description": "Applies one of the four forward transitions of a booking: `confirm`, `check_in`, `complete`, `no_show`. Each is checked against the state matrix; an illegal transition is a 409 that names the current status.\nUse it to record what happened. `no_show` is a fact being recorded, not a cancellation: to cancel, use `bookrail_booking_cancel`.\nReturns: the booking after the transition.\nNext: `bookrail_booking_get`, or the transition its `next_transition` names.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "booking_id": {
          "type": "string",
          "description": "The booking id (`bk_...`)."
        },
        "action": {
          "type": "string",
          "enum": [
            "confirm",
            "check_in",
            "complete",
            "no_show"
          ],
          "description": "Which transition to apply."
        }
      },
      "required": [
        "booking_id",
        "action"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Move a booking forward",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": false,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_booking_cancel",
    "title": "Cancel a booking",
    "description": "Cancels a booking, releases its capacity and computes the refund the frozen policy snapshot entitles the customer to.\nIRREVERSIBLE: a cancelled booking does not come back, it is created again. So without `confirm: true` this tool returns the booking as it stands today plus `requires_confirmation: true`, and changes nothing.\nReturns: the cancelled booking, with `refund_percent` and `refund_amount_expected`. Payments do not exist yet, so the refund is an expectation, not a movement.\nNext: `bookrail_booking_get` to read it back.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "booking_id": {
          "type": "string",
          "description": "The booking id (`bk_...`)."
        },
        "reason": {
          "type": "string",
          "description": "Free text kept on the booking."
        },
        "by": {
          "type": "string",
          "enum": [
            "customer",
            "provider",
            "system"
          ],
          "description": "Who wanted the cancellation. It decides which policy ladder applies."
        },
        "refund_percent": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Override the percentage the policy would compute."
        },
        "confirm": {
          "type": "boolean",
          "default": false,
          "description": "Must be true to actually perform this irreversible operation. With false (the default) the tool returns a preview and requires_confirmation: true, and changes nothing."
        }
      },
      "required": [
        "booking_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Cancel a booking",
      "readOnlyHint": false,
      "destructiveHint": true,
      "idempotentHint": false,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_booking_reschedule",
    "title": "Move a booking to another instant",
    "description": "Moves a booking to a new instant. The answer is the NEW booking; the old one becomes \"rescheduled\" and is reachable at `rescheduled_from_booking_id`.\nUse it instead of cancel-and-rebook: rescheduling keeps the link, counts against `max_reschedules`, and applies the reschedule ladder of the policy rather than the cancellation one.\nReturns: the new booking.\nNext: `bookrail_booking_get` on the returned `id`.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "booking_id": {
          "type": "string",
          "description": "The booking to move (`bk_...`)."
        },
        "start": {
          "type": "string",
          "description": "The new instant, ISO 8601 with an explicit offset."
        },
        "resource_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Pin specific resources for the new slot."
        }
      },
      "required": [
        "booking_id",
        "start"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Move a booking to another instant",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": false,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_objects_list",
    "title": "List objects of one collection",
    "description": "Lists the objects of one collection: locations, resources, resource_groups, schedules, services, policies, customers.\nUse it after `bookrail_config_push` to read back the ids the API assigned (`svc_...`, `res_...`): a configuration uses logical ids, and the prefixed ids only exist after a push. `metadata.config_id` on each object is the logical id it came from.\nReturns: `{ data: [...], has_more, next_cursor }`.\nNext: `bookrail_availability` with the `svc_` id of a service.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "kind": {
          "type": "string",
          "enum": [
            "locations",
            "resources",
            "resource_groups",
            "schedules",
            "services",
            "policies",
            "customers"
          ],
          "description": "Which collection to act on."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Default 20, at most 100."
        },
        "starting_after": {
          "type": "string",
          "description": "Cursor: the id of the last row you saw."
        },
        "all": {
          "type": "boolean",
          "default": false,
          "description": "Follow the cursor to the end and return everything."
        },
        "expand": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Linked objects to inline. resources: schedule. resource_groups: resources. services: requirements."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "List objects of one collection",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_resource_blocks",
    "title": "List the closed periods of a resource",
    "description": "Lists the blocks on one resource: the periods it is closed for (holidays, maintenance) without the schedule saying so.\nUse it to find the `blk_...` of a block you want to lift, which is the only way to lift one, and to explain why a resource is unavailable on a day its schedule says it is open. Without `from`/`to` it returns the blocks that have not finished yet.\nReturns: `{ data: [{ id, resource_id, from, to, reason, metadata }], has_more, next_cursor }`. Instants are UTC.\nNext: `bookrail_explain_unavailable` if a block is not what you expected; the unblock itself is `POST /v1/resources/{id}/unblock` with the `blk_...`, which no tool wraps yet.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "resource_id": {
          "type": "string",
          "description": "The resource id (`res_...`)."
        },
        "from": {
          "type": "string",
          "description": "ISO 8601 instant with an offset. Blocks ending after it."
        },
        "to": {
          "type": "string",
          "description": "ISO 8601 instant with an offset. Blocks starting before it."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Default 20, at most 100."
        },
        "starting_after": {
          "type": "string",
          "description": "Cursor: the `blk_...` of the last row you saw."
        },
        "all": {
          "type": "boolean",
          "default": false,
          "description": "Follow the cursor to the end and return everything."
        }
      },
      "required": [
        "resource_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "List the closed periods of a resource",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_object_get",
    "title": "Read one object",
    "description": "Returns one object of one collection by its prefixed id.\nUse it to close the loop after a write, and to read `metadata.config_id` to find out whether an object is managed by a configuration.\nReturns: the object.\nNext: `bookrail_object_update`, or `bookrail_config_push` if the object is managed by a configuration. Editing a managed object outside the file makes the next push undo the change.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "kind": {
          "type": "string",
          "enum": [
            "locations",
            "resources",
            "resource_groups",
            "schedules",
            "services",
            "policies",
            "customers"
          ],
          "description": "Which collection to act on."
        },
        "id": {
          "type": "string",
          "description": "The prefixed id, e.g. `svc_...`."
        },
        "expand": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Linked objects to inline."
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read one object",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_object_create",
    "title": "Create one object directly",
    "description": "Creates one object through the API, bypassing the configuration file.\nPrefer `bookrail_config_push`: an object created here carries no `metadata.config_id`, so a later push will never update or delete it, and it shows up as `unmanaged`. Use this for something genuinely outside the model: a customer, a one-off resource.\nThe body uses the API field names (`location_id`, `schedule_id`), not the configuration ones (`location`, `schedule`). Call `bookrail_docs_get` with path \"api\" for the reference.\nReturns: the created object.\nNext: `bookrail_object_get` to read it back.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "kind": {
          "type": "string",
          "enum": [
            "locations",
            "resources",
            "resource_groups",
            "schedules",
            "services",
            "policies",
            "customers"
          ],
          "description": "Which collection to act on."
        },
        "data": {
          "type": "object",
          "additionalProperties": {},
          "description": "The object body, in API field names."
        }
      },
      "required": [
        "kind",
        "data"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Create one object directly",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": false,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_object_update",
    "title": "Update one object directly",
    "description": "Patches one object. Only the fields you send are changed, except the sub-lists (`rules`, `resource_ids`, `requirements`), where the set you send REPLACES the whole set.\nIf the object carries `metadata.config_id` it is managed by a configuration file, and the next `bookrail_config_push` will put it back the way the file describes. Change the file instead.\nReturns: the updated object.\nNext: `bookrail_object_get`, or `bookrail_availability` when the change could affect what is bookable.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "kind": {
          "type": "string",
          "enum": [
            "locations",
            "resources",
            "resource_groups",
            "schedules",
            "services",
            "policies",
            "customers"
          ],
          "description": "Which collection to act on."
        },
        "id": {
          "type": "string",
          "description": "The prefixed id."
        },
        "data": {
          "type": "object",
          "additionalProperties": {},
          "description": "The fields to change, in API field names."
        }
      },
      "required": [
        "kind",
        "id",
        "data"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Update one object directly",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_object_delete",
    "title": "Delete one object",
    "description": "Deletes one object. Resources and services are soft-deleted (they disappear from reads); everything else is removed. References from other objects become null.\nIRREVERSIBLE: without `confirm: true` this tool returns the object as it stands today plus `requires_confirmation: true`, and deletes nothing. Read the preview, in particular `metadata.config_id`, which tells you whether a configuration file still declares it.\nReturns: `{ id, deleted: true }`.\nNext: `bookrail_config_push` with dry_run: true, to check the configuration and the project still agree.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "kind": {
          "type": "string",
          "enum": [
            "locations",
            "resources",
            "resource_groups",
            "schedules",
            "services",
            "policies",
            "customers"
          ],
          "description": "Which collection to act on."
        },
        "id": {
          "type": "string",
          "description": "The prefixed id."
        },
        "confirm": {
          "type": "boolean",
          "default": false,
          "description": "Must be true to actually perform this irreversible operation. With false (the default) the tool returns a preview and requires_confirmation: true, and changes nothing."
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Delete one object",
      "readOnlyHint": false,
      "destructiveHint": true,
      "idempotentHint": false,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_events_list",
    "title": "Read the event log",
    "description": "Lists the events of the project (booking.created, booking.cancelled, booking.orphaned, hold.expired and the rest), newest page first, in a total order that is safe to page through.\nUse it to find out what a call actually did, to check that a change produced the event you expected, and as the payload reference for a webhook handler: an event here is byte for byte what a delivery would have carried.\nReturns: `{ data: [{ id, type, occurred_at, actor, data: { object, previous } }], has_more, next_cursor }`.\nNext: `bookrail_event_get` for one of them; `bookrail_webhook_create` to receive them instead of polling.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "type": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Only these event types, e.g. [\"booking.created\"]."
        },
        "object_id": {
          "type": "string",
          "description": "Only events about this object."
        },
        "from": {
          "type": "string",
          "description": "ISO 8601 instant with an offset."
        },
        "to": {
          "type": "string",
          "description": "ISO 8601 instant with an offset."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Default 20, at most 100."
        },
        "starting_after": {
          "type": "string",
          "description": "Cursor: the id of the last event you saw."
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read the event log",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_event_get",
    "title": "Read one event",
    "description": "Returns one event with its full payload: the object as it is after the change, and the previous version where there is one.\nUse it when an event id came from a webhook delivery or from `bookrail_events_list` and you need the whole body.\nReturns: the event object.\nNext: `bookrail_booking_get` on `data.object.id` if it is a booking event.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "event_id": {
          "type": "string",
          "description": "The event id (`evt_...`)."
        }
      },
      "required": [
        "event_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read one event",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_webhook_list",
    "title": "List webhook endpoints",
    "description": "Lists the webhook endpoints of the project with their URL, subscribed events and status.\nUse it before creating one, so you do not add a second endpoint for the same URL.\nReturns: `{ data: [{ id, url, events, status }], has_more, next_cursor }`. The signing secret is never returned here: it is shown only once, by `bookrail_webhook_create`.\nNext: `bookrail_webhook_test` to make one deliver now.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "starting_after": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "List webhook endpoints",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_webhook_create",
    "title": "Register a webhook endpoint",
    "description": "Registers an endpoint to deliver events to, and returns its signing secret. That is the only time it is shown: no other call ever returns it again, not even an idempotent replay.\nUse it when wiring an application to Bookrail. Store the secret in the application's environment immediately (BOOKRAIL_WEBHOOK_SECRET) and verify every `Bookrail-Signature` with it.\nOn live only https is accepted; on test http is allowed on ports 80, 443 and 8080-8099.\nReturns: `{ id, url, events, status, secret }`.\nNext: `bookrail_webhook_test` to deliver a synthetic event and see what the endpoint answers.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "url": {
          "type": "string",
          "description": "Where deliveries go, e.g. https://example.com/api/bookrail."
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Event types to subscribe to. Omit for all of them."
        },
        "description": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {}
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Register a webhook endpoint",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": false,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_webhook_test",
    "title": "Deliver a synthetic event now",
    "description": "Delivers a synthetic event to one endpoint, synchronously, and returns what the endpoint answered.\nUse it to check a handler end to end without creating a real booking.\nReturns: `{ status: \"succeeded\" | \"failed\", response_status, duration_ms, error? }`. `ok` stays true even when the endpoint answers 500: the delivery happened, and that IS the answer. Branch on `data.status`.\nNext: `bookrail_webhook_deliveries` to read the endpoint's log.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "webhook_id": {
          "type": "string",
          "description": "The endpoint id (`wh_...`)."
        }
      },
      "required": [
        "webhook_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Deliver a synthetic event now",
      "readOnlyHint": false,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_webhook_deliveries",
    "title": "Read the delivery log of an endpoint",
    "description": "Lists the deliveries attempted to one endpoint, with attempt number, response status, duration, error and when the next retry is due.\nUse it when an endpoint is not receiving what you expect: it distinguishes \"never sent\" from \"sent and refused\".\nReturns: `{ data: [{ id, event_id, status, attempt, response_status, error, next_attempt_at }], has_more }`.\nNext: `bookrail_event_get` on a delivery's `event_id` to see what was sent.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "webhook_id": {
          "type": "string",
          "description": "The endpoint id (`wh_...`)."
        },
        "status": {
          "type": "string",
          "description": "pending, succeeded, failed."
        },
        "event": {
          "type": "string",
          "description": "Only deliveries of this event type."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "required": [
        "webhook_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Read the delivery log of an endpoint",
      "readOnlyHint": true,
      "destructiveHint": false,
      "idempotentHint": true,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  },
  {
    "name": "bookrail_webhook_delete",
    "title": "Remove a webhook endpoint",
    "description": "Removes an endpoint. Events stop being delivered to it immediately, and its signing secret is gone: re-creating the endpoint gives a new one, and every handler verifying the old secret breaks.\nIRREVERSIBLE: without `confirm: true` the tool returns the endpoint as it stands and `requires_confirmation: true`, and removes nothing.\nReturns: `{ id, deleted: true }`.\nNext: `bookrail_webhook_list` to check what is left.",
    "inputSchema": {
      "type": "object",
      "properties": {
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "default": "test",
          "description": "Which environment to operate on. Defaults to \"test\". \"live\" is refused unless the server was started with BOOKRAIL_MCP_ALLOW_LIVE=1 and a live key is configured."
        },
        "webhook_id": {
          "type": "string",
          "description": "The endpoint id (`wh_...`)."
        },
        "confirm": {
          "type": "boolean",
          "default": false,
          "description": "Must be true to actually perform this irreversible operation. With false (the default) the tool returns a preview and requires_confirmation: true, and changes nothing."
        }
      },
      "required": [
        "webhook_id"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    },
    "annotations": {
      "title": "Remove a webhook endpoint",
      "readOnlyHint": false,
      "destructiveHint": true,
      "idempotentHint": false,
      "openWorldHint": true
    },
    "execution": {
      "taskSupport": "forbidden"
    },
    "outputSchema": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "description": "False only when `error` is set."
        },
        "environment": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ],
          "description": "The environment this call ran against."
        },
        "data": {
          "description": "The payload, identical to `bookrail ... --json`."
        },
        "next_steps": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What to do next, as tool calls."
        },
        "requires_confirmation": {
          "type": "boolean",
          "description": "True when nothing was done and the call must be repeated with confirm: true."
        },
        "preview": {
          "description": "What a confirmed call would do."
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "param": {
              "type": "string"
            },
            "doc_url": {
              "type": "string"
            },
            "fix": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message",
            "doc_url"
          ],
          "additionalProperties": false,
          "description": "Set when ok is false. `fix` is the sentence to act on."
        }
      },
      "required": [
        "ok",
        "environment"
      ],
      "additionalProperties": false,
      "$schema": "http://json-schema.org/draft-07/schema#"
    }
  }
]
