Skip to main content
Glama

patchDocumentAttachment

Idempotent

Update an existing Document attachment's metadata and optionally replace its stored file while preserving the attachment ID. Use it to rename or re-upload a file already in Polarion.

Instructions

Updates one existing Document attachment: its metadata (e.g. title) via requestBody.resource, and optionally replaces the stored file by passing base64-encoded bytes in requestBody.content. The attachment keeps its ID. Use this to rename or re-upload a file that already exists; to add a new file use postDocumentItemAttachments, and to read the current file use getDocumentAttachmentContent. Effect: idempotent — calling it again with the same input leaves the resource in the same end state, with no additional side effects. Tip: set dry_run: true first to validate the arguments and preview the exact request without sending it to Polarion. The executor returns this preview as normal text, and as structured content when the tool declares an output schema.

Input Schema

NameRequiredDescriptionDefault
dry_runNoIf true, validates the request and returns the exact request that would be sent to Polarion — with the Authorization header redacted and any binary payload summarized by byte length — without actually sending it.
spaceIdYesThe Document Space ID (a folder-like grouping of documents/pages within a project). Use `_default` (no quotes) to address the project's default space.
projectIdYesThe Polarion project ID (its URL segment, e.g. `myproject`), case-sensitive. Required to scope the request to one project. If the ID is unknown, ask the user; getProjects lists IDs only with global read access.
requestBodyNoAttachment metadata and file data.
attachmentIdYesThe attachment's ID, as returned by the corresponding list- or get-attachments call for this resource.
documentNameYesThe Document name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.4
    • changedInput schema / properties / projectId / description
      Previous value: -"The Polarion project ID (its URL segment, e.g. `myproject`), case-sensitive. Required to scope the request to one project; call getProjects to list valid IDs."New value: +"The Polarion project ID (its URL segment, e.g. `myproject`), case-sensitive. Required to scope the request to one project. If the ID is unknown, ask the user; getProjects lists IDs only with global read access."
  2. Changed4 schema fields changedv1.2.0
    • changedInput schema / properties / attachmentId / description
      Previous value: -"The Attachment ID."New value: +"The attachment's ID, as returned by the corresponding list- or get-attachments call for this resource."
    • changedInput schema / properties / dry_run / description
      Previous value: -"If true, validate and return the request that would be sent without calling Polarion."New value: +"If true, validates the request and returns the exact request that would be sent to Polarion — with the Authorization header redacted and any binary payload summarized by byte length — without actually sending it."
    • changedInput schema / properties / projectId / description
      Previous value: -"The Project ID."New value: +"The Polarion project ID (its URL segment, e.g. `myproject`), case-sensitive. Required to scope the request to one project; call getProjects to list valid IDs."
    • changedInput schema / properties / spaceId / description
      Previous value: -"The Space ID. (Use '_default' without quotes to address the default Space.)"New value: +"The Document Space ID (a folder-like grouping of documents/pages within a project). Use `_default` (no quotes) to address the project's default space."
  3. Changed2 schema fields changed
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "If true, validate and return the request that would be sent without calling Polarion.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / requestBody / description
      Previous value: -"Attachment meta data and file data."New value: +"Attachment metadata and file data."
  4. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, and the description restates idempotency in prose — redundant but harmless, and it clarifies that the attachment keeps its ID. The description does add real behavioral context beyond the annotations: the distinction between metadata-only patching and full file replacement, and exactly what `dry_run` returns (text preview plus structured content when an output schema exists). It does not say whether replaced file content leaves any recoverable prior version, which is the main remaining gap for a file-replacing mutation.

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 core operation, the ID-preservation note, and the sibling routing are front-loaded in the first two sentences. The trailing sentence about the executor returning the preview as text and structured content is mildly verbose and less essential to invocation, keeping this just short of a 5.

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 6-parameter mutation tool with no output schema, the description covers the mutation semantics, ID stability, alternatives for the neighbouring operations, and a validation path via `dry_run`. Nothing an agent needs in order to call this correctly is missing, and the schema plus annotations fill in the rest (required IDs, safety hints).

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 description coverage is 100%, so the baseline is 3, but the description genuinely compensates for the weakest field: `requestBody` is documented in the schema only as 'Attachment metadata and file data', and the description splits it into `requestBody.resource` for metadata (e.g. `title`) and `requestBody.content` for base64-encoded bytes. That is meaningful semantics the schema does not supply.

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?

Uses a specific verb and resource ('Updates one existing Document attachment') and precisely scopes what parts get updated: metadata via `requestBody.resource` and optionally the stored file via `requestBody.content`. It explicitly names the sibling tools that handle the adjacent operations (`postDocumentItemAttachments`, `getDocumentAttachmentContent`), so an agent can disambiguate without reading either schema.

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?

States the when-to-use case ('rename or re-upload a file that already exists') and pairs it with explicit alternatives for the adjacent cases: adding a new file and reading the current file. It also gives a recommended workflow step ('set `dry_run: true` first to validate the arguments') which is actionable guidance rather than a restatement of capability.

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

Deploy Server

Other Tools