Skip to main content
Glama

update_document

DestructiveIdempotent

Update a Polarion document's metadata or body by patching only the specified attributes, preserving unchanged fields. Use workflow actions for status transitions to enforce project rules.

Instructions

Update a Polarion document's metadata or body.

PATCHes only the attributes you set; omitted fields are preserved server-side. Unlike update_work_item this does NOT follow up with a GET — call get_document if you need the refreshed state.

home_page_content_html is the round-trip pair for get_document(include_homepage_content_html=True). The HTML is sent verbatim with no sanitization, so XSS/script filtering is delegated to Polarion's renderer — NEVER pass untrusted input. Empty string is rejected (would wipe the body and orphan every heading); pass '<p></p>' for a near-empty body.

Body-write behaviour:

  • Heading auto-create: inline <h1>..<h4> tags become heading work items with module and outline_number set automatically. A bare <hN>Title</hN> alone is safe.

  • Orphan headings: removing an <hN> removes the part but leaves the heading work item behind (still module-linked, no outline_number).

  • DO NOT inject anchorless <p> paragraphs: ``X

  • DO NOT inject work item macro references: appending <div id="polarion_wiki macro name=module-workitem;params=id=NEW"> creates a workitem_<NEW> part visible in read_document_parts but leaves the work item's module relationship unset (space_id="", outline_number="") — an inconsistent half-attached state. Always attach via move_work_item_to_document.

Workflow: prefer workflow_action over a raw status edit so project rules run. workflow_action MUST be paired with at least one attribute field — Polarion rejects empty PATCH bodies. Direct status / type writes are NOT validated server-side: unknown ids are stored verbatim as ghost values. Resolve valid ids first via list_document_enum_options(project_id, field_id, document_type). Unknown custom_fields IDs also become ghost attributes; pass keys from a prior get_document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesPolarion project ID.
space_idYesSpace ID (use '_default' for the default space).
document_nameYesDocument name within ``space_id``.
titleNoNew title (None to leave unchanged).
statusNoNew workflow status; prefer ``workflow_action`` for real transitions.
typeNoNew document type (e.g. 'req_specification').
home_page_content_htmlNoNew body as raw Polarion HTML (round-trip shape from get_document); '' is rejected.
custom_fieldsNoPartial custom-field update; rich-text values must be ``{'type':'text/html','value':...}``.
workflow_actionNoWorkflow action ID; must be paired with at least one attribute field.
dry_runNoWhen True, return payload preview without calling Polarion.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatedYesTrue on a real PATCH; False on dry-run.
dry_runYesWhether this was a dry-run.
payload_previewYesJSON:API payload sent or previewed; None after real ops.
Behavior5/5

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

Annotations (destructiveHint, idempotentHint) are supplemented by extensive behavioral details: PATCH semantics, body-write behaviors (heading auto-create, orphan headings, anchorless paragraphs causing 500), workflow pairing requirement, validation gaps (ghost values), and XSS warnings. Exceeds annotation scope.

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?

Dense but well-structured with sections (body-write, workflow). Every sentence adds value, though length could be slightly reduced without loss. Front-loaded with purpose and key contrast.

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 complexity (10 params, destructive, openWorldHint), description covers error states, preconditions, alternatives, and interaction with other tools. Output schema exists, so return values are not needed. Thorough and complete.

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 covers 100% of parameters, but description adds significant meaning: home_page_content_html round-trip and rejection of '', workflow_action pairing requirement, custom_fields rich-text format, dry_run preview behavior. Enriches beyond schema definitions.

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?

Clearly states 'Update a Polarion document's metadata or body' and distinguishes from siblings like update_work_item and create_document. The verb 'update' with specific resource 'Polarion document' and fields (metadata, body) is precise.

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?

Explicitly contrasts with update_work_item (no GET follow-up) and advises to use get_document for refreshed state. Provides when to use workflow_action vs direct status edit, and warns about pitfalls like anchorless paragraphs and orphan headings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/devemberx/mcp-server-polarion'

If you have feedback or need assistance with the MCP directory API, please join our Discord server