Skip to main content
Glama

Update document metadata values

update-document-metadata-values
Destructive

Set 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 value

  • unset: 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 monthly or yearly -> "EUR;1000.10;monthly" / "USD;1000.10;yearly"

  • select: one of the options from the metadata's select_values list -> "red"

  • multi_select: an array of the selected values in the values field -> ["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

TableJSON Schema
NameRequiredDescriptionDefault
document_uuidYesUUID 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_changesNoThe metadata value changes to apply (at most 10 per request)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
unset_metadataNoThe metadata whose values were removed by `unset` changes (an `unset` of a metadata that had no value is omitted)
set_metadata_valuesNoThe metadata values that were created or updated by `set` changes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true and readOnlyHint=false, so the mutation risk is covered structurally. The description adds real behavioral context on top: identifier mismatches fail validation, unsupported metadata types fail validation, and per-value_type construction rules. It stops short of saying whether an unset is recoverable or what happens on partial failure of a multi-entry batch, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The when-to-use block and per-type value rules are front-loaded and each bullet carries necessary information an agent would otherwise have to guess. It is long, but the length is largely earned; the only marginal cost is the exhaustive type enumeration, which could be slightly tighter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, nested-array mutation tool, the description covers the operation semantics, the identifier resolution path, the max-10 batch constraint, value serialization per type, and the failure conditions. An output schema exists, so return values need no explanation here. Nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (baseline 3), and the description goes well beyond it. It explains that identifier accepts either metadata_uuid or name, that operation set creates-or-updates while unset removes, and it supplies exact value formats for number, currency, currency_duration, select, multi_select, bool, duration, date, and text types — meaning an agent can construct valid input without guessing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a precise verb and resource: set or unset the value of one or more of a document's metadata. It is trivially distinguishable from neighbors such as update-document-tags, update-document-dynamic-fields, or update-document itself, since it names the exact object being mutated and the exact operations available.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It has an explicit 'Use this tool when' block covering both the set and unset intents, and it names the discovery alternatives (list-account-metadata, get-document-info with include=["metadata_values"]) that must be consulted first. It also states a when-not: computed metadata or metadata driven by a dynamic field cannot be changed and will fail validation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources