get_work_package_schema
Retrieve the schema for creating or updating work packages in OpenProject, specifying required fields and structure based on project and optional work type.
Instructions
Get the schema for creating/updating work packages.
Args:
project_id: Project identifier or ID
type_id: Optional type ID to get type-specific schema
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| type_id | No |
Implementation Reference
- Core handler function that retrieves the work package schema from the OpenProject API for a given project, optionally filtered by work package type ID. It constructs the API request with filters if type_id is provided and returns the schema object.async def get_work_package_schema( project_id: str, type_id: int | None = None ) -> dict[str, Any]: """Get the schema for creating/updating work packages. This returns available fields, required fields, and allowed values for a work package in a specific project. Args: project_id: Project identifier or ID type_id: Optional type ID to get type-specific schema Returns: Schema object with available fields and constraints """ client = OpenProjectClient() try: params = {} if type_id: params["filters"] = f'[{{"type":{{"operator":"=","values":["{type_id}"]}}}}]' result = await client.get( f"projects/{project_id}/work_packages/schema", params=params ) return result finally: await client.close()
- src/openproject_mcp/server.py:163-173 (registration)MCP tool registration using @mcp.tool() decorator. This wrapper function defines the tool interface and delegates execution to the implementation in work_packages.get_work_package_schema.@mcp.tool() async def get_work_package_schema(project_id: str, type_id: int | None = None): """Get the schema for creating/updating work packages. Args: project_id: Project identifier or ID type_id: Optional type ID to get type-specific schema """ return await work_packages.get_work_package_schema( project_id=project_id, type_id=type_id )