Skip to main content
Glama

Update document metadata values

update-document-metadata-values
DestructiveIdempotent

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "document_uuid": "<document_uuid>"
    },
    "name": "update-document-metadata-values"
  }
}

Input 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

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.9/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true; the description adds what is actually destroyed ('unset' removes the document's existing value), which identifiers cause validation failure, and that some metadata types are read-only in practice. That is real context an agent cannot get from the annotations.

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?

Well front-loaded and scannable with bullets for operations and value types. Minor redundancy: the two 'Use this tool when' bullets largely restate the opening sentence, and the type-rules block is long (though each rule is load-bearing).

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?

Covers identifier discovery, operation semantics, per-type value formatting, the unset case, and failure modes; an output schema exists so return values need not be explained. 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%, so the baseline would be 3, but the schema only says 'the value to set' while the description specifies exact construction rules per value_type (number, currency, currency_duration, select, multi_select, bool, duration, date). This is essential, non-schema information — an agent could not construct a valid currency or duration value without it.

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?

Opens with a precise verb pair and resource: 'Set or unset the value of one or more of a document's metadata.' That distinguishes document-level metadata *values* from account-level metadata definitions (create-account-metadata / update-account-metadata) and from generic document edits in update-document.

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?

Explicit 'Use this tool when' bullets cover both the set and unset cases, and it routes the agent to list-account-metadata or get-document-info to obtain valid identifiers. It also states an exclusion — computed or dynamic-field-driven metadata cannot be changed — so the agent knows when the call will fail.

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