Skip to main content
Glama

get_work_package_relations

Read-onlyIdempotent

Retrieve a work package's relations—such as blocks, duplicates, or relates to—with stored direction IDs and a caller-perspective reading to clarify actual relation direction.

Instructions

Get the relations of one work package (blocks, relates to, duplicates, etc.).

type/from_id/to_id reflect how OpenProject actually stored the relation, which does not depend on which work package's relations you query, but can differ from how it was originally requested, since OpenProject canonicalizes some relation types at creation time (e.g. a relation requested as 'precedes' is stored as 'follows' with from_id/to_id swapped; see create_work_package_relation). Use from_id/to_id together with type, not the request you expect to have made, to determine the actual direction.

Each result additionally carries queried_perspective, a caller-relative reading of the same relation from work_package_id's own side; never a replacement for type/from_id/to_id, which stay unchanged. queried_perspective.direction is "from" or "to" (which raw id equals work_package_id); queried_perspective.effective_type is the type as read FROM work_package_id's side (e.g. a stored "blocks" relation reads as effective_type="blocked" when work_package_id is the to_id side, "blocks" when it's the from_id side). queried_perspective.predecessor_id/successor_id are populated only for the precedes/follows type pair (OpenProject's own scheduling-relevant relation types); both stay null for every other type, since no other type has an equivalent first/second concept.

total is only the count of allowed relations returned on THIS page, not a full count of all matches; the search stops as soon as it has enough, so an exact total would need an extra full walk. Page until next_offset is null.

Input Schema

NameRequiredDescriptionDefault
limitNoPage size, capped at OPENPROJECT_MAX_PAGE_SIZE.
offsetNo1-based page number; pass the previous result's next_offset.
selectNoFields to return; a requested unset field comes back as null. Allowed: description, description_length, description_truncated, from_id, from_subject, id, queried_perspective, to_id, to_subject, type.
work_package_idYesWork package id (e.g. 952) or display id (e.g. "PROJ-51"), not the bare number 51.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.4
  2. Removedv0.4.0
  3. Changed1 schema field changedv0.3.7
    • addedInput schema / additionalProperties
      Added value: +false
  4. Changed2 schema fields changedv0.3.5
    • addedInput schema / properties / limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Limit"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 1,
      +  "title": "Offset",
      +  "type": "integer"
      +}
  5. Addedv0.3.3
  6. Removedv0.3.0
  7. Changed1 schema field changedv0.2.3
    • changedOutput schema / (root)
      Previous value: -{
      -  "$defs": {
      -    "RelationSummary": {
      -      "properties": {
      -        "description": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "title": "Description"
      -        },
      -        "from_id": {
      -          "anyOf": [
      -            {
      -              "type": "integer"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "title": "From Id"
      -        },
      -        "from_subject": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "title": "From Subject"
      -        },
      -        "id": {
      -          "title": "Id",
      -          "type": "integer"
      -        },
      -        "to_id": {
      -          "anyOf": [
      -            {
      -              "type": "integer"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "title": "To Id"
      -        },
      -        "to_subject": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "title": "To Subject"
      -        },
      -        "type": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "title": "Type"
      -        }
      -      },
      -      "required": [
      -        "id",
      -        "type",
      -        "description",
      -        "from_id",
      -        "from_subject",
      -        "to_id",
      -        "to_subject"
      -      ],
      -      "title": "RelationSummary",
      -      "type": "object"
      -    }
      -  },
      -  "properties": {
      -    "count": {
      -      "title": "Count",
      -      "type": "integer"
      -    },
      -    "results": {
      -      "items": {
      -        "$ref": "#/$defs/RelationSummary"
      -      },
      -      "title": "Results",
      -      "type": "array"
      -    }
      -  },
      -  "required": [
      -    "count",
      -    "results"
      -  ],
      -  "title": "RelationListResult",
      -  "type": "object"
      -}New value: +null
  8. First observedv0.2.2

TDQS

A4/5.0
Behavior5/5

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

Annotations already cover read-only and idempotent safety, and the description adds substantial behavioral context: OpenProject canonicalizes relation types at creation, from_id/to_id must be used with type for direction, queried_perspective is caller-relative, and total is only a page count with pagination until next_offset is null. This goes well beyond what annotations provide.

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 description is front-loaded with a clear purpose sentence and then provides dense but relevant nuance about canonicalization and queried_perspective. It is longer than typical, but every sentence earns its place given the subtle relation-direction semantics.

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 no output schema, the description carries the full burden of explaining return values, and it does so thoroughly: it describes type/from_id/to_id, queried_perspective fields, pagination limits, and next_offset behavior. An agent has enough information to interpret results correctly.

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%, so the schema already documents limit, offset, select, and work_package_id. The description adds useful pagination behavior (total is page-only; page until next_offset is null), but it does not add meaning to the individual input parameters beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence clearly states the specific verb and resource: retrieving relations for one work package, with examples of relation types. It does not explicitly differentiate this tool from the sibling list_relations, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains how to interpret returned direction and pagination, but it never states when to use this tool versus alternatives like list_relations or get_work_package. Usage is implied rather than explicitly guided.

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