Skip to main content
Glama

update_document

DestructiveIdempotent

Update a Polarion document's metadata, body, or layout by patching only the supplied attributes, leaving all other fields unchanged.

Instructions

Update a document's metadata or body.

PATCHes only supplied attributes — omitted fields stay unchanged; read BEFORE writing. home_page_content_html is raw Polarion HTML, sent verbatim — source from get_document(include_home_page_content_html=True); an empty string is rejected, pass '' for near-empty.

Body rules:

  • Inline .. auto-create heading work items — THE way to add a heading. For body text or work items use create_work_items + move_work_item_to_document, NOT this tool.

  • A polarion_wiki macro name=module-workitem leaves module unset — attach via move_work_item_to_document.

  • Tables, captions, image embeds, links, TOC/TOF widgets, page breaks must come from get_html_recipes templates, never hand-written. attachment:{id} refs must name a real attachment — confirm via list_document_attachments first.

rendering_layout_types REPLACES the type set get_document returns — pass every type to keep; existing layouts survive.

workflow_action must pair with at least one attribute. Unknown status/type ids and custom_fields keys outside the type schema are rejected — resolve ids via list_document_enum_options, or list_work_item_enum_options for rendering_layout_types.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoNew document type (e.g. 'req_specification').
titleNoNew document title.
statusNoNew status; prefer workflow_action for real transitions.
dry_runNoPreview payload without writing; guards still query Polarion.
space_idYesSpace ID ('_default' = default space).
project_idYesPolarion project ID.
auto_suspectNoFlag linked work items suspect on change.
custom_fieldsNoPartial; rich-text values as {'type':'text/html','value':...}.
document_nameYesDocument name within space_id.
workflow_actionNoWorkflow action ID.
home_page_content_htmlNoNew body as raw HTML from get_document(include_home_page_content_html=True); '' rejected; anchorless blocks get id= auto-stamped. New tables, captions, images, or other Polarion constructs: call get_html_recipes first and adapt a template.
rendering_layout_typesNoWork item type IDs that render their fields in this document; REPLACES the current set, so pass every type to keep.
uses_outline_numberingNoEnable auto outline numbers (1, 1.1, ...).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runYes
updatedYes
payload_previewYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.0
    • addedInput schema / properties / rendering_layout_types
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "minItems": 1,
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Work item type IDs that render their fields in this document; REPLACES the current set, so pass every type to keep."
      +}
  2. Addedv2.0.0
  3. Removedv2.0.0
  4. Changed3 schema fields changedv1.4.1
    • addedInput schema / properties / auto_suspect
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Flag linked work items suspect on change."
      +}
    • changedInput schema / properties / home_page_content_html / description
      Previous value: -"New body as raw HTML from get_document(include_homepage_content_html=True); '' rejected; anchorless blocks get id= auto-stamped."New value: +"New body as raw HTML from get_document(include_homepage_content_html=True); '' rejected; anchorless blocks get id= auto-stamped. New tables, captions, or other Polarion constructs: call get_html_recipes first and adapt a template."
    • addedInput schema / properties / uses_outline_numbering
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Enable auto outline numbers (1, 1.1, ...)."
      +}
  5. Changed7 schema fields changedv1.4.0
    • changedInput schema / properties / custom_fields / description
      Previous value: -"Partial custom-field update; rich-text values must be ``{'type':'text/html','value':...}``."New value: +"Partial; rich-text values as {'type':'text/html','value':...}."
    • changedInput schema / properties / document_name / description
      Previous value: -"Document name within ``space_id``."New value: +"Document name within space_id."
    • changedInput schema / properties / dry_run / description
      Previous value: -"When True, return the payload preview without writing; enum/custom-field guards still query Polarion, so the document must be readable and the validation endpoint reachable."New value: +"Preview payload without writing; guards still query Polarion."
    • changedInput schema / properties / home_page_content_html / description
      Previous value: -"New body as raw Polarion HTML (round-trip shape from get_document); '' is rejected."New value: +"New body as raw HTML from get_document(include_homepage_content_html=True); '' rejected; anchorless blocks get id= auto-stamped."
    • changedInput schema / properties / space_id / description
      Previous value: -"Space ID (use '_default' for the default space)."New value: +"Space ID ('_default' = default space)."
    • changedInput schema / properties / status / description
      Previous value: -"New workflow status; prefer ``workflow_action`` for real transitions."New value: +"New status; prefer workflow_action for real transitions."
    • changedInput schema / properties / workflow_action / description
      Previous value: -"Workflow action ID; must be paired with at least one attribute field."New value: +"Workflow action ID."
  6. Changed7 schema fields changedv1.1.0
    • changedInput schema / properties / dry_run / description
      Previous value: -"When True, return payload preview without calling Polarion."New value: +"When True, return the payload preview without writing; enum/custom-field guards still query Polarion, so the document must be readable and the validation endpoint reachable."
    • removedInput schema / properties / title / description
      Removed value: -"New title (None to leave unchanged)."
    • removedOutput schema / $defs
      Removed value: -{
      -  "JsonValue": {
      -    "anyOf": [
      -      {
      -        "type": "string"
      -      },
      -      {
      -        "type": "integer"
      -      },
      -      {
      -        "type": "number"
      -      },
      -      {
      -        "type": "boolean"
      -      },
      -      {
      -        "items": {
      -          "$ref": "#/$defs/JsonValue"
      -        },
      -        "type": "array"
      -      },
      -      {
      -        "additionalProperties": {
      -          "$ref": "#/$defs/JsonValue"
      -        },
      -        "type": "object"
      -      },
      -      {
      -        "type": "null"
      -      }
      -    ]
      -  }
      -}
    • removedOutput schema / properties / dry_run / description
      Removed value: -"Whether this was a dry-run."
    • changedOutput schema / properties / payload_preview / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": {
      -      "$ref": "#/$defs/JsonValue"
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / payload_preview / description
      Removed value: -"JSON:API payload sent or previewed; None after real ops."
    • removedOutput schema / properties / updated / description
      Removed value: -"True on a real PATCH; False on dry-run."
  7. First observedv0.9.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond annotations by explaining PATCH semantics ('omitted fields stay unchanged'), raw HTML handling ('empty string rejected, pass '<p></p>''), and rendering_layout_types replacement behavior. Also warns about validation of status/type ids and custom_fields.

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

Conciseness5/5

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

The description is long but efficiently structured: purpose first, then PATCH semantics, HTML guidance, body rules, and layout/workflow constraints. Every sentence carries essential information for safe usage.

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?

Given the complexity (13 parameters) and rich schema, the description is comprehensive: it covers edge cases (empty string rejection), alternative tools, and validation rules. It fully prepares an agent to invoke the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. Description adds meaningful cross-parameter constraints (e.g., workflow_action must pair with an attribute) and source guidance (home_page_content_html from get_document). This pushes it above baseline, though some parameters rely solely on schema.

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?

'Update a document's metadata or body' clearly states the action and resource. It distinguishes from siblings by explicitly directing users to other tools for body text and work items: 'For body text or work items use create_work_items + move_work_item_to_document, NOT this tool.'

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?

Provides explicit 'read BEFORE writing' and detailed when-to-use guidance. It names alternatives for body text and attachments, and specifies constraints like 'workflow_action must pair with at least one attribute' and 'resolve ids via list_document_enum_options'.

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