Update document metadata values
update-document-metadata-valuesSet or unset the value of one or more of a document's metadata.
Use this tool when:
You want to fill in (or change) a document's metadata values
You want to remove a value the document currently has for a metadata
Each entry in metadata_value_changes identifies the metadata by its metadata_uuid or name (use list-account-metadata, or get-document-info with include=["metadata_values"], to discover them) — sending an identifier that does not match any of the account's metadata will fail validation.
Each entry also has an operation:
set: create the metadata value (if the document does not have one yet) or update the existing valueunset: remove the document's value for the metadata (no value is required)
For a set, take note of the metadata's value_type when constructing the value. These are the rules to use when constructing the value string:
number: the numeric value in a string, using '.' as the decimal separator -> "1234.56"
currency: concatenate the ISO currency code and the numeric value with a ';' -> "EUR;1000.10" (for one thousand Euro and ten cents)
currency_duration: same as currency, but append another ';' followed by either
monthlyoryearly-> "EUR;1000.10;monthly" / "USD;1000.10;yearly"select: one of the options from the metadata's
select_valueslist -> "red"multi_select: an array of the selected values in the
valuesfield -> ["red", "blue"]bool: either of the strings "true" (displayed to the user as "Yes") or "false" (displayed to the user as "No") -> "true" / "false"
duration: a PHP-compatible duration specification -> "P6D" (6 days), "P2W" (2 weeks), "PT12H" (12 hours)
date: the date in the format "YYYY-MM-DD" -> "2026-12-31"
email, text, textarea, or any type not listed above: a string -> "test@example.com"
Some metadata cannot be changed this way (e.g. computed metadata, or metadata whose value is driven by a dynamic field) — attempting to do so will fail validation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_uuid | Yes | UUID of the document whose metadata values are to be updated. If you don't already have the document's UUID, use the list-documents tool to find it. | |
| metadata_value_changes | No | The metadata value changes to apply (at most 10 per request) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unset_metadata | No | The metadata whose values were removed by `unset` changes (an `unset` of a metadata that had no value is omitted) | |
| set_metadata_values | No | The metadata values that were created or updated by `set` changes |