Skip to main content
Glama
dev-in-black

OpenProject MCP Server

by dev-in-black

update_work_package

Modify existing work packages by updating subject, description, status, priority, or assignee in OpenProject project management.

Instructions

Update an existing work package.

Args:
    work_package_id: Work package ID
    lock_version: Current lock version (get from work package first)
    subject: New subject/title
    description: New description in markdown
    status_id: New status ID
    priority_id: New priority ID
    assignee_id: New assignee user ID (use 0 to unassign)
    notify: Whether to send notifications (default: True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
work_package_idYes
lock_versionYes
subjectNo
descriptionNo
status_idNo
priority_idNo
assignee_idNo
notifyNo

Implementation Reference

  • Core implementation of the update_work_package tool: constructs payload with optional fields and performs PATCH request to OpenProject API.
    async def update_work_package(
        work_package_id: int,
        lock_version: int,
        subject: str | None = None,
        description: str | None = None,
        status_id: int | None = None,
        priority_id: int | None = None,
        assignee_id: int | None = None,
        notify: bool = True,
    ) -> dict[str, Any]:
        """Update an existing work package.
    
        Args:
            work_package_id: Work package ID
            lock_version: Current lock version (get from work package first)
            subject: New subject/title
            description: New description in markdown
            status_id: New status ID
            priority_id: New priority ID
            assignee_id: New assignee user ID (use 0 to unassign)
            notify: Whether to send notifications (default: True)
    
        Returns:
            Updated work package object
        """
        client = OpenProjectClient()
    
        try:
            payload: dict[str, Any] = {
                "lockVersion": lock_version,
                "_links": {},
            }
    
            if subject is not None:
                payload["subject"] = subject
    
            if description is not None:
                payload["description"] = build_formattable(description)
    
            if status_id is not None:
                payload["_links"]["status"] = build_link(f"/api/v3/statuses/{status_id}")
    
            if priority_id is not None:
                payload["_links"]["priority"] = build_link(
                    f"/api/v3/priorities/{priority_id}"
                )
    
            if assignee_id is not None:
                if assignee_id == 0:
                    payload["_links"]["assignee"] = None
                else:
                    payload["_links"]["assignee"] = build_link(
                        f"/api/v3/users/{assignee_id}"
                    )
    
            params = {"notify": str(notify).lower()}
    
            result = await client.patch(
                f"work_packages/{work_package_id}?notify={params['notify']}", data=payload
            )
            return result
        finally:
            await client.close()
  • MCP tool registration using @mcp.tool() decorator. Defines input schema via type annotations and delegates to the core handler.
    @mcp.tool()
    async def update_work_package(
        work_package_id: int,
        lock_version: int,
        subject: str | None = None,
        description: str | None = None,
        status_id: int | None = None,
        priority_id: int | None = None,
        assignee_id: int | None = None,
        notify: bool = True,
    ):
        """Update an existing work package.
    
        Args:
            work_package_id: Work package ID
            lock_version: Current lock version (get from work package first)
            subject: New subject/title
            description: New description in markdown
            status_id: New status ID
            priority_id: New priority ID
            assignee_id: New assignee user ID (use 0 to unassign)
            notify: Whether to send notifications (default: True)
        """
        return await work_packages.update_work_package(
            work_package_id=work_package_id,
            lock_version=lock_version,
            subject=subject,
            description=description,
            status_id=status_id,
            priority_id=priority_id,
            assignee_id=assignee_id,
            notify=notify,
        )

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/dev-in-black/openproject-mcp'

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