MCPOutils MCP/Champs personnalisés/set_custom_field_value

set_custom_field_value

Writecustom-fields:write

Set (or clear) one custom-field value on a location or client. The field must already exist — look it up with list_custom_field_definitions and pass its key. Passing null or an empty value clears the field. The value is validated against the field's type (text/number/date/single_select/multi_select) before saving. Returns the entity's full updated values bag. You don't pass an agency — it comes from your credentials.

Paramètres
entityType"location" | "client"obligatoire
Which kind of entity entityId refers to (required).
entityIdstringobligatoire
The entity's id — a location's id (from list_locations / create_location) when entityType is "location", or a client's id (from list_clients / create_client) when entityType is "client".
keystringobligatoire
The custom field's key (from list_custom_field_definitions), not its label.
valuestringfacultatif
The new value. A string for text/date/single_select; also accepts a number for number fields or an array of strings for multi_select (the schema type here is advisory — the actual value is validated against the field's real type). Pass null/omit to clear.
Exemple de requête
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "set_custom_field_value",
    "arguments": {
      "entityType": "location",
      "entityId": "string",
      "key": "string"
    }
  }
}
Exemple de réponse
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "..."
      }
    ]
  }
}

La forme de la réponse est indicative — le contenu réel dépend de l'outil et de vos données.