Skip to content

Commit 89835c4

Browse files
floatingIce91DevRev
andauthored
added subtype to update work tool (#40)
https://app.devrev.ai/devrev/works/ISS-175688 --------- Co-authored-by: DevRev <devrev@DevRevs-MacBook-Pro.local>
1 parent 1933323 commit 89835c4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/devrev_mcp/server.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ async def handle_list_tools() -> list[types.Tool]:
101101
"owned_by": {"type": "array", "items": {"type": "string"}, "description": "The DevRev IDs of the users who are assigned to the work item"},
102102
"stage": {"type": "string", "description": "The stage name of the work item. Use valid_stage_transition tool to get the list of valid stages you an update to."},
103103
"sprint": {"type": "string", "description": "The DevRev ID of the sprint to be assigned to an issue."},
104+
"subtype": {
105+
"type": "object",
106+
"properties": {
107+
"drop": {"type": "boolean", "description": "If true, the subtype will be dropped from the work item. If false, the subtype will be added to the work item."},
108+
"subtype": {"type": "string", "description": "The subtype value of the work item. Remember to use list_subtypes tool to get the list of valid subtypes."}
109+
},
110+
"required": ["drop"]
111+
}
104112
},
105113
"required": ["id", "type"],
106114
},
@@ -678,6 +686,13 @@ async def handle_call_tool(
678686
if sprint:
679687
payload["sprint"] = sprint
680688

689+
subtype = arguments.get("subtype")
690+
if subtype:
691+
if subtype["drop"]:
692+
payload["custom_schema_spec"] = {"drop": {"subtype": True}, "tenant_fragment": True, "validate_required_fields": True}
693+
else:
694+
payload["custom_schema_spec"] = {"subtype": subtype["subtype"], "tenant_fragment": True, "validate_required_fields": True}
695+
681696
response = make_devrev_request(
682697
"works.update",
683698
payload

0 commit comments

Comments
 (0)