Skip to main content
Glama
dev-in-black

OpenProject MCP Server

by dev-in-black

set_parent_work_package

Assign or remove a parent work package to establish hierarchical relationships between tasks in OpenProject.

Instructions

Set or remove the parent of a work package.

Args:
    work_package_id: Child work package ID
    parent_id: Parent work package ID (use None to remove parent)
    lock_version: Current lock version (get from work package first)
    notify: Whether to send notifications (default: True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
work_package_idYes
parent_idYes
lock_versionYes
notifyNo

Implementation Reference

  • Core handler function that uses OpenProjectClient to PATCH the work package endpoint, constructing a payload to set or clear the parent link while handling lock version and notifications.
    async def set_parent_work_package(
        work_package_id: int,
        parent_id: int | None,
        lock_version: int,
        notify: bool = True,
    ) -> dict[str, Any]:
        """Set or remove the parent of a work package.
    
        Args:
            work_package_id: Child work package ID
            parent_id: Parent work package ID (use None to remove parent)
            lock_version: Current lock version (get from work package first)
            notify: Whether to send notifications (default: True)
    
        Returns:
            Updated work package object
        """
        client = OpenProjectClient()
    
        try:
            payload: dict[str, Any] = {
                "lockVersion": lock_version,
                "_links": {},
            }
    
            if parent_id is None:
                # Remove parent by setting it to null
                payload["_links"]["parent"] = None
            else:
                # Set parent
                payload["_links"]["parent"] = build_link(
                    f"/api/v3/work_packages/{parent_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 decorator registration in the server, which proxies arguments to the core implementation in work_packages module.
    async def set_parent_work_package(
        work_package_id: int,
        parent_id: int | None,
        lock_version: int,
        notify: bool = True,
    ):
        """Set or remove the parent of a work package.
    
        Args:
            work_package_id: Child work package ID
            parent_id: Parent work package ID (use None to remove parent)
            lock_version: Current lock version (get from work package first)
            notify: Whether to send notifications (default: True)
        """
        return await work_packages.set_parent_work_package(
            work_package_id=work_package_id,
            parent_id=parent_id,
            lock_version=lock_version,
            notify=notify,
        )
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool can both set and remove parents, mentions lock version requirements, and includes notification behavior. However, it doesn't cover important behavioral aspects like permissions needed, whether this is a destructive/mutative operation, error conditions, or what happens to child work packages when parent is removed.

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 appropriately sized with a clear purpose statement followed by parameter explanations. Every sentence adds value, though the parameter section could be slightly more structured. It's front-loaded with the core functionality before parameter details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description does reasonably well on parameters but lacks important context. It doesn't explain what the tool returns, error conditions, or the full behavioral implications of parent removal. Given the complexity of parent-child relationships in work packages, more completeness would be beneficial.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining all 4 parameters. It clarifies that parent_id accepts 'None to remove parent', explains lock_version must be 'get from work package first', and specifies notify's default value. This adds crucial semantic meaning beyond the bare schema.

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?

The description clearly states the specific action ('Set or remove the parent') and resource ('work package'), distinguishing it from siblings like create_work_package or update_work_package which handle different operations. It precisely defines the tool's function without ambiguity.

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 implies usage for parent-child relationship management but doesn't explicitly state when to use this tool versus alternatives like update_work_package or create_relation. It mentions the need to 'get lock version from work package first' which provides some context, but lacks explicit when/when-not guidance compared to siblings.

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

Install Server

Other Tools

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