patch_orgs_bulk

Changes data · you confirm first

Calls PATCH /api/orgs/bulk as the signed-in person · REST reference

Apply the same field changes to several organizations

Platform staff only (there is no dedicated org-status command permission). Each id is loaded and saved independently via Promise.allSettled, so this is NOT atomic: the response reports per-id success and failure and a partial application is the normal outcome of a bad id. Only status, name, address, phone and email are copied from updates; any other key in the object is ignored silently and still echoed back under updates. Ids that do not resolve land in failed at 200 — they do not produce a 404.

Arguments

ArgumentTypeDescription
bodyJSONobjectrequiredThe request body, as a JSON object. Its fields are listed below.

Fields of body

FieldTypeDescription
orgIdsarray of string (uuid)required
updatesobjectrequiredAt least one key. Only the five allow-listed fields are applied; everything else is dropped without comment.
updates.addressstring
updates.emailstring (email)
updates.namestring
updates.phonestring
updates.status"ACTIVE" | "INACTIVE" | "SUSPENDED"

Example call

A client sends this over the MCP session; Claude and other agents build it for you. The values are placeholders — the shape is real.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "patch_orgs_bulk",
    "arguments": {
      "body": {
        "orgIds": [
          "11111111-1111-4111-8111-111111111111"
        ],
        "updates": {
          "address": "string",
          "email": "name@example.org",
          "name": "string",
          "phone": "string",
          "status": "ACTIVE"
        }
      }
    }
  }
}
Confirmation
The client shows the person the exact request and waits. Nothing runs until they tick Make this change. See Reading and changing.

Result

On success (HTTP 200) the tool returns one text item holding the API's JSON, pretty-printed.

Per-id outcome. Returned even when every id failed.

json
{
  "failed": [
    {
      "error": "string",
      "id": "11111111-1111-4111-8111-111111111111",
      "status": 1
    }
  ],
  "message": "string",
  "successful": [
    "11111111-1111-4111-8111-111111111111"
  ],
  "total": 1,
  "updates": {}
}

Fields

FieldTypeDescription
failedarray of object
failed[].errorstringThat answer's message — the DAL's own sentence for a 400/404/409, a constant otherwise; never upstream text.
failed[].idstring (uuid)
failed[].statusintegerThe status this id's failure would be answered with alone — 404 for no such organization, the DAL refusal's by its code, 503 when the DAL could not be reached, 500 otherwise.
messagestring
successfularray of string (uuid)
totalintegerLength of the submitted orgIds.
updatesobjectThe submitted object, echoed unfiltered.

When it fails

A failed call returns isError: true with the API's message as text. A change the person declines, or lets time out, also comes back this way and nothing changes.

400

orgIds absent/empty/not an array, or updates absent/empty.

403

Authenticated, but the caller holds none of the required permissions.

What the model is shown

This is the tool exactly as the server lists it in tools/list. The description starts with the REST call it makes.

json
{
  "name": "patch_orgs_bulk",
  "description": "PATCH /api/orgs/bulk — Platform staff only (there is no dedicated org-status command permission). Each id is loaded and saved independently via `Promise.allSettled`, so this is NOT atomic: the response reports per-id success and failure and a partial application is the normal outcome of a bad id. Only `status`, `name`, `address`, `phone` and `email` are copied from `updates`; any other key in the object is ignored silently and still echoed back under `updates`. Ids that do not resolve land in `failed` at 200 — they do not produce a 404.\n\nThis changes data. The person is asked to confirm it before it runs, and nothing happens if they decline.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "body": {
        "type": "string",
        "description": "The JSON request body: { orgIds*: array of string; updates*: { address: string; email: string; name: string; phone: string; status: one of \"ACTIVE\" | \"INACTIVE\" | \"SUSPENDED\" } (At least one key.) }"
      }
    },
    "required": [
      "body"
    ]
  },
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": false,
    "openWorldHint": false
  }
}