@shortcut/mcp 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14799,11 +14799,11 @@ class ShortcutClientWrapper {
|
|
|
14799
14799
|
throw new Error(`Failed to create the task: ${response.status}`);
|
|
14800
14800
|
return task;
|
|
14801
14801
|
}
|
|
14802
|
-
async addRelationToStory(storyPublicId, linkedStoryId) {
|
|
14802
|
+
async addRelationToStory(storyPublicId, linkedStoryId, verb) {
|
|
14803
14803
|
const response = await this.client.createStoryLink({
|
|
14804
14804
|
object_id: linkedStoryId,
|
|
14805
14805
|
subject_id: storyPublicId,
|
|
14806
|
-
verb
|
|
14806
|
+
verb
|
|
14807
14807
|
});
|
|
14808
14808
|
const storyLink = response?.data ?? null;
|
|
14809
14809
|
if (!storyLink)
|
|
@@ -21563,7 +21563,7 @@ var import_client = __toESM(require_lib(), 1);
|
|
|
21563
21563
|
|
|
21564
21564
|
// package.json
|
|
21565
21565
|
var name = "@shortcut/mcp";
|
|
21566
|
-
var version = "0.
|
|
21566
|
+
var version = "0.6.1";
|
|
21567
21567
|
|
|
21568
21568
|
// src/tools/base.ts
|
|
21569
21569
|
class BaseTools {
|
|
@@ -21710,7 +21710,7 @@ var formatUsersList = (users) => {
|
|
|
21710
21710
|
};
|
|
21711
21711
|
|
|
21712
21712
|
// src/tools/utils/search.ts
|
|
21713
|
-
var keyRenames = {
|
|
21713
|
+
var keyRenames = { name: "title" };
|
|
21714
21714
|
var mapKeyName = (key) => {
|
|
21715
21715
|
const lowercaseKey = key.toLowerCase();
|
|
21716
21716
|
return keyRenames[lowercaseKey] || lowercaseKey;
|
|
@@ -22101,9 +22101,10 @@ The story will be added to the default state for the workflow.
|
|
|
22101
22101
|
taskDescription: z.string().min(1).describe("The description of the task"),
|
|
22102
22102
|
taskOwnerIds: z.array(z.string()).optional().describe("Array of user IDs to assign as owners of the task")
|
|
22103
22103
|
}, async (params) => await tools.addTaskToStory(params));
|
|
22104
|
-
server.tool("add-relation-to-story", "Add a
|
|
22104
|
+
server.tool("add-relation-to-story", "Add a story relationship to a story", {
|
|
22105
22105
|
storyPublicId: z.number().positive().describe("The public ID of the story"),
|
|
22106
|
-
relatedStoryPublicId: z.number().positive().describe("The public ID of the related story")
|
|
22106
|
+
relatedStoryPublicId: z.number().positive().describe("The public ID of the related story"),
|
|
22107
|
+
relationshipType: z.enum(["relates to", "blocks", "blocked by", "duplicates", "duplicated by"]).optional().default("relates to").describe("The type of relationship")
|
|
22107
22108
|
}, async (params) => await tools.addRelationToStory(params));
|
|
22108
22109
|
server.tool("update-task", "Update a task in a story", {
|
|
22109
22110
|
storyPublicId: z.number().positive().describe("The public ID of the story"),
|
|
@@ -22336,7 +22337,8 @@ ${comment.text || ""}`;
|
|
|
22336
22337
|
}
|
|
22337
22338
|
async addRelationToStory({
|
|
22338
22339
|
storyPublicId,
|
|
22339
|
-
relatedStoryPublicId
|
|
22340
|
+
relatedStoryPublicId,
|
|
22341
|
+
relationshipType
|
|
22340
22342
|
}) {
|
|
22341
22343
|
if (!storyPublicId)
|
|
22342
22344
|
throw new Error("Story public ID is required");
|
|
@@ -22348,8 +22350,15 @@ ${comment.text || ""}`;
|
|
|
22348
22350
|
const relatedStory = await this.client.getStory(relatedStoryPublicId);
|
|
22349
22351
|
if (!relatedStory)
|
|
22350
22352
|
throw new Error(`Failed to retrieve Shortcut story with public ID: ${relatedStoryPublicId}`);
|
|
22351
|
-
|
|
22352
|
-
|
|
22353
|
+
let subjectStoryId = storyPublicId;
|
|
22354
|
+
let objectStoryId = relatedStoryPublicId;
|
|
22355
|
+
if (relationshipType === "blocked by" || relationshipType === "duplicated by") {
|
|
22356
|
+
relationshipType = relationshipType === "blocked by" ? "blocks" : "duplicates";
|
|
22357
|
+
subjectStoryId = relatedStoryPublicId;
|
|
22358
|
+
objectStoryId = storyPublicId;
|
|
22359
|
+
}
|
|
22360
|
+
await this.client.addRelationToStory(subjectStoryId, objectStoryId, relationshipType);
|
|
22361
|
+
return this.toResult(relationshipType === "blocks" ? `Marked sc-${subjectStoryId} as a blocker to sc-${objectStoryId}.` : relationshipType === "duplicates" ? `Marked sc-${subjectStoryId} as a duplicate of sc-${objectStoryId}.` : `Added a relationship between sc-${subjectStoryId} and sc-${objectStoryId}.`);
|
|
22353
22362
|
}
|
|
22354
22363
|
}
|
|
22355
22364
|
|