Skip to main content
Glama

getFieldsMetadataForDocument

Read-only

Retrieve a Document's field definitions—IDs, labels, types, and custom fields—before writing, so you know which field keys and value types are valid.

Instructions

Returns the field definitions that apply to one specific Document, keyed by field ID: each field's label and type kind (primitive such as string/date/text/html, list, structure, or enumeration with its enum name), including the custom fields configured for its type. Use it before writing to the Document to learn which field keys and value types are valid. For the allowed values of one enum field, follow up with getAvailableEnumOptionsForDocument. For the project-wide definitions of a resource type without a concrete instance, use getProjectFieldsMetadata; for global defaults, getGlobalFieldsMetadata.

Input Schema

NameRequiredDescriptionDefault
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.
documentNameYesThe Branch Document Name.
response_formatNoResponse detail level. concise removes redundant HTML and JSON:API metadata and may use a small default fieldset on large lists; detailed preserves the complete response. Defaults to detailed.detailed

Output Schema

NameRequiredDescriptionDefault
dataNo
linksNo

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. Changed1 schema field changedv1.4.0
    • addedInput schema / properties / response_format
      Added value: +{
      +  "default": "detailed",
      +  "description": "Response detail level. concise removes redundant HTML and JSON:API metadata and may use a small default fieldset on large lists; detailed preserves the complete response. Defaults to detailed.",
      +  "enum": [
      +    "concise",
      +    "detailed"
      +  ],
      +  "type": "string"
      +}
  3. Changed54 schema fields changedv1.3.1
    • removedOutput schema / properties / data / properties / attributes / properties / enumField / properties / label / example
      Removed value: -"field-label"
    • changedOutput schema / properties / data / properties / attributes / properties / enumField / properties / label / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / enumField / properties / type / properties / enumContext / example
      Removed value: -"enum-context"
    • changedOutput schema / properties / data / properties / attributes / properties / enumField / properties / type / properties / enumContext / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / enumField / properties / type / properties / enumName / example
      Removed value: -"enum-name"
    • changedOutput schema / properties / data / properties / attributes / properties / enumField / properties / type / properties / enumName / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / enumField / properties / type / properties / kind / example
      Removed value: -"enumeration"
    • changedOutput schema / properties / data / properties / attributes / properties / enumField / properties / type / properties / kind / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / enumField / properties / type / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / enumField / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / listField / properties / label / example
      Removed value: -"field-label"
    • changedOutput schema / properties / data / properties / attributes / properties / listField / properties / label / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / properties / itemType / properties / kind / properties / enum / items / enum
      Removed value: -[
      -  "string",
      -  "text",
      -  "text/html",
      -  "integer",
      -  "float",
      -  "currency",
      -  "time",
      -  "date",
      -  "date-time",
      -  "boolean",
      -  "structure",
      -  "relationship"
      -]
    • changedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / properties / itemType / properties / kind / properties / enum / items / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / properties / itemType / properties / kind / properties / enum / type
      Previous value: -"array"New value: +[
      +  "array",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / properties / itemType / properties / kind / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / properties / itemType / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / properties / kind / example
      Removed value: -"list"
    • changedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / properties / kind / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / listField / properties / type / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / listField / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / primitiveField / properties / label / example
      Removed value: -"field-label"
    • changedOutput schema / properties / data / properties / attributes / properties / primitiveField / properties / label / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / primitiveField / properties / type / properties / kind / properties / enum / items / enum
      Removed value: -[
      -  "string",
      -  "text",
      -  "text/html",
      -  "integer",
      -  "float",
      -  "currency",
      -  "time",
      -  "date",
      -  "date-time",
      -  "boolean"
      -]
    • changedOutput schema / properties / data / properties / attributes / properties / primitiveField / properties / type / properties / kind / properties / enum / items / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / primitiveField / properties / type / properties / kind / properties / enum / type
      Previous value: -"array"New value: +[
      +  "array",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / primitiveField / properties / type / properties / kind / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / primitiveField / properties / type / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / primitiveField / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / structField / properties / label / example
      Removed value: -"field-label"
    • changedOutput schema / properties / data / properties / attributes / properties / structField / properties / label / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / structField / properties / type / properties / kind / example
      Removed value: -"structure"
    • changedOutput schema / properties / data / properties / attributes / properties / structField / properties / type / properties / kind / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / attributes / properties / structField / properties / type / properties / structureName / example
      Removed value: -"structureId"
    • changedOutput schema / properties / data / properties / attributes / properties / structField / properties / type / properties / structureName / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / structField / properties / type / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / properties / structField / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / attributes / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / label / example
      Removed value: -"field-label"
    • changedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / label / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / properties / kind / example
      Removed value: -"relationship"
    • changedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / properties / kind / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / properties / multi / example
      Removed value: -true
    • changedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / properties / multi / type
      Previous value: -"boolean"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • removedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / properties / targetResourceTypes / items / example
      Removed value: -"resource-type"
    • changedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / properties / targetResourceTypes / items / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / properties / targetResourceTypes / type
      Previous value: -"array"New value: +[
      +  "array",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / relationships / properties / relationshipField / properties / type / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / relationships / properties / relationshipField / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / properties / relationships / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / data / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • removedOutput schema / properties / links / properties / self / example
      Removed value: -"https://example.com/polarion/rest/v1/projects/MyProjectId/actions/getFieldsMetadata?resourceType=MyResourceType&targetType=MyTargetType"
    • changedOutput schema / properties / links / properties / self / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number",
      +  "integer",
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / links / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
  4. Changed2 schema fields changedv1.2.0
    • 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."
  5. Changed1 schema field changedv1.1.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "data": {
      +      "properties": {
      +        "attributes": {
      +          "properties": {
      +            "enumField": {
      +              "properties": {
      +                "label": {
      +                  "example": "field-label",
      +                  "type": "string"
      +                },
      +                "type": {
      +                  "properties": {
      +                    "enumContext": {
      +                      "example": "enum-context",
      +                      "type": "string"
      +                    },
      +                    "enumName": {
      +                      "example": "enum-name",
      +                      "type": "string"
      +                    },
      +                    "kind": {
      +                      "example": "enumeration",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "listField": {
      +              "properties": {
      +                "label": {
      +                  "example": "field-label",
      +                  "type": "string"
      +                },
      +                "type": {
      +                  "properties": {
      +                    "itemType": {
      +                      "properties": {
      +                        "kind": {
      +                          "properties": {
      +                            "enum": {
      +                              "items": {
      +                                "enum": [
      +                                  "string",
      +                                  "text",
      +                                  "text/html",
      +                                  "integer",
      +                                  "float",
      +                                  "currency",
      +                                  "time",
      +                                  "date",
      +                                  "date-time",
      +                                  "boolean",
      +                                  "structure",
      +                                  "relationship"
      +                                ],
      +                                "type": "string"
      +                              },
      +                              "type": "array"
      +                            }
      +                          },
      +                          "type": "object"
      +                        }
      +                      },
      +                      "type": "object"
      +                    },
      +                    "kind": {
      +                      "example": "list",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "primitiveField": {
      +              "properties": {
      +                "label": {
      +                  "example": "field-label",
      +                  "type": "string"
      +                },
      +                "type": {
      +                  "properties": {
      +                    "kind": {
      +                      "properties": {
      +                        "enum": {
      +                          "items": {
      +                            "enum": [
      +                              "string",
      +                              "text",
      +                              "text/html",
      +                              "integer",
      +                              "float",
      +                              "currency",
      +                              "time",
      +                              "date",
      +                              "date-time",
      +                              "boolean"
      +                            ],
      +                            "type": "string"
      +                          },
      +                          "type": "array"
      +                        }
      +                      },
      +                      "type": "object"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "structField": {
      +              "properties": {
      +                "label": {
      +                  "example": "field-label",
      +                  "type": "string"
      +                },
      +                "type": {
      +                  "properties": {
      +                    "kind": {
      +                      "example": "structure",
      +                      "type": "string"
      +                    },
      +                    "structureName": {
      +                      "example": "structureId",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "relationships": {
      +          "properties": {
      +            "relationshipField": {
      +              "properties": {
      +                "label": {
      +                  "example": "field-label",
      +                  "type": "string"
      +                },
      +                "type": {
      +                  "properties": {
      +                    "kind": {
      +                      "example": "relationship",
      +                      "type": "string"
      +                    },
      +                    "multi": {
      +                      "example": true,
      +                      "type": "boolean"
      +                    },
      +                    "targetResourceTypes": {
      +                      "items": {
      +                        "example": "resource-type",
      +                        "type": "string"
      +                      },
      +                      "type": "array"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "links": {
      +      "properties": {
      +        "self": {
      +          "example": "https://example.com/polarion/rest/v1/projects/MyProjectId/actions/getFieldsMetadata?resourceType=MyResourceType&targetType=MyTargetType",
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  6. Added

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds useful scope behavior — results are keyed by field ID and include the custom fields configured for that document type — plus the recommended call ordering. It stops short of noting permission requirements or the practical impact of response_format, leaving the read-only/behavioral picture only modestly enriched beyond annotations and the output schema.

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?

Three tightly packed sentences: what it returns, when to call it, then a routing table of follow-ups and alternatives. Front-loaded with the resource and scope, zero filler, and the sibling pointers are grouped at the end where they are easiest to scan.

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?

With an output schema present, the description needn't document return values, and 100% parameter coverage means the schema carries argument semantics. What remains — disambiguation from three similarly named metadata tools and correct call sequencing before a write — is fully addressed.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already explains projectId, spaceId (including the `_default` sentinel), documentName, and response_format in detail. The description adds no parameter-level guidance beyond restating that the result targets one specific Document, so the baseline of 3 applies.

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?

States a specific verb and resource (returns field definitions for one specific Document) and then enumerates the payload shape: field ID keys, label, and type kind (primitive, list, structure, enumeration with enum name). It immediately distinguishes itself from getProjectFieldsMetadata and getGlobalFieldsMetadata by scope (concrete instance vs. type-wide vs. global).

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?

Gives an explicit use case ('Use it before writing to the Document to learn which field keys and value types are valid'), a named follow-up for the enum-value case (getAvailableEnumOptionsForDocument), and two named alternatives with the exact condition that selects each. Nothing is left to inference.

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