MCPMCP Tools/Custom Fields
Custom Fields
Define custom fields and set their values on clients.
- Readlist_custom_field_definitionsList the agency's custom-field schema for locations or clients — the extra fields an agency has defined beyond the built-in profile fields (e.g. "Franchise ID", "Contract renewal date"). Use this before get_custom_field_values or set_custom_field_value to discover what keys/types exist. Each definition has an id, an immutable key (used with set_custom_field_value), a label, a type (text/number/date/single_select/multi_select), whether it's required, its select options (for select types), and its display order. Archived definitions are excluded. You don't pass an agency — it comes from your credentials.
- Writecreate_custom_fieldCreate a new custom-field definition for locations or clients — adds a new column of information every location (or client) can carry, beyond the built-in profile fields. A URL-safe key is generated automatically from the label (renaming the label later never changes the key or breaks stored values). select types (single_select / multi_select) require at least one option. New definitions are appended to the end of the display order. Returns the new definition, including its generated key — use that key with set_custom_field_value. You don't pass an agency — it comes from your credentials.
- Writeupdate_custom_fieldEdit an existing custom-field definition's label, required flag, select options, or display order. The field's type and key cannot be changed after creation — to change the type, archive this field with delete_custom_field and create a new one. Pass only the fields you want to change. Identify the field by its id (from list_custom_field_definitions). You don't pass an agency — it comes from your credentials.
- Writedelete_custom_fieldArchive a custom-field definition, removing it from the schema. This is a soft delete — previously stored values for this field are retained on each entity but the field itself no longer appears in list_custom_field_definitions or accepts new values via set_custom_field_value. Identify the field by its id (from list_custom_field_definitions). You don't pass an agency — it comes from your credentials.
- Readget_custom_field_valuesGet the custom-field values currently set on one location or client. Returns a { key: value } bag (empty object if none are set). Use list_custom_field_definitions first to see what keys exist. You don't pass an agency — it comes from your credentials, and an entity from another agency is never returned.
- Writeset_custom_field_valueSet (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.