list_work_package_relations
Retrieve all relationships for a work package to understand task dependencies and connections within OpenProject.
Instructions
Get all relations for a work package.
Args:
work_package_id: Work package ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| work_package_id | Yes |
Implementation Reference
- Core handler function that fetches the list of relations for a given work package ID using the OpenProjectClient.async def list_work_package_relations(work_package_id: int) -> dict[str, Any]: """Get all relations for a work package. Args: work_package_id: Work package ID Returns: Collection of relations (parent, blocks, relates, etc.) """ client = OpenProjectClient() try: result = await client.get(f"work_packages/{work_package_id}/relations") return result finally: await client.close()
- src/openproject_mcp/server.py:319-329 (registration)MCP tool registration using @mcp.tool() decorator. This is the entry point for the tool, delegating to the core implementation in relations.py.@mcp.tool() async def list_work_package_relations(work_package_id: int): """Get all relations for a work package. Args: work_package_id: Work package ID """ return await relations.list_work_package_relations( work_package_id=work_package_id )