@delorenj/mcp-server-trello 1.2.0 → 1.5.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/README.md +383 -373
- package/build/health/health-endpoints.d.ts +131 -0
- package/build/health/health-endpoints.js +476 -0
- package/build/health/health-endpoints.js.map +1 -0
- package/build/health/health-monitor.d.ts +136 -0
- package/build/health/health-monitor.js +507 -0
- package/build/health/health-monitor.js.map +1 -0
- package/build/index.js +756 -1
- package/build/index.js.map +1 -1
- package/build/trello-client.d.ts +14 -1
- package/build/trello-client.js +164 -68
- package/build/trello-client.js.map +1 -1
- package/build/types.d.ts +2 -2
- package/package.json +12 -27
package/build/index.js
CHANGED
|
@@ -1,2 +1,757 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{McpServer}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport}from"@modelcontextprotocol/sdk/server/stdio.js";import{z}from"zod";import{TrelloClient}from"./trello-client.js";class TrelloServer{constructor(){const t=process.env.TRELLO_API_KEY,e=process.env.TRELLO_TOKEN,r=process.env.TRELLO_BOARD_ID;if(!t||!e)throw new Error("TRELLO_API_KEY and TRELLO_TOKEN environment variables are required");this.trelloClient=new TrelloClient({apiKey:t,token:e,defaultBoardId:r,boardId:r}),this.server=new McpServer({name:"trello-server",version:"1.0.0"}),this.setupTools(),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}setupTools(){this.server.registerTool("get_cards_by_list_id",{title:"Get Cards by List ID",description:"Fetch cards from a specific Trello list on a specific board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)"),listId:z.string().describe("ID of the Trello list")}},async({boardId:t,listId:e})=>{try{const r=await this.trelloClient.getCardsByList(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_lists",{title:"Get Lists",description:"Retrieve all lists from the specified board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)")}},async({boardId:t})=>{try{const e=await this.trelloClient.getLists(t);return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_recent_activity",{title:"Get Recent Activity",description:"Fetch recent activity on the Trello board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)"),limit:z.number().optional().default(10).describe("Number of activities to fetch (default: 10)")}},async({boardId:t,limit:e})=>{try{const r=await this.trelloClient.getRecentActivity(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("add_card_to_list",{title:"Add Card to List",description:"Add a new card to a specified list on a specific board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)"),listId:z.string().describe("ID of the list to add the card to"),name:z.string().describe("Name of the card"),description:z.string().optional().describe("Description of the card"),dueDate:z.string().optional().describe("Due date for the card (ISO 8601 format)"),start:z.string().optional().describe("Start date for the card (YYYY-MM-DD format, date only)"),labels:z.array(z.string()).optional().describe("Array of label IDs to apply to the card")}},async t=>{try{const e=await this.trelloClient.addCard(t.boardId,t);return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("update_card_details",{title:"Update Card Details",description:"Update an existing card's details on a specific board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)"),cardId:z.string().describe("ID of the card to update"),name:z.string().optional().describe("New name for the card"),description:z.string().optional().describe("New description for the card"),dueDate:z.string().optional().describe("New due date for the card (ISO 8601 format)"),start:z.string().optional().describe("New start date for the card (YYYY-MM-DD format, date only)"),dueComplete:z.boolean().optional().describe("Mark the due date as complete (true) or incomplete (false)"),labels:z.array(z.string()).optional().describe("New array of label IDs for the card")}},async t=>{try{const e=await this.trelloClient.updateCard(t.boardId,t);return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("archive_card",{title:"Archive Card",description:"Send a card to the archive on a specific board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)"),cardId:z.string().describe("ID of the card to archive")}},async({boardId:t,cardId:e})=>{try{const r=await this.trelloClient.archiveCard(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("move_card",{title:"Move Card",description:"Move a card to a different list, potentially on a different board",inputSchema:{boardId:z.string().optional().describe("ID of the target Trello board (where the listId resides, uses default if not provided)"),cardId:z.string().describe("ID of the card to move"),listId:z.string().describe("ID of the target list")}},async({boardId:t,cardId:e,listId:r})=>{try{const o=await this.trelloClient.moveCard(t,e,r);return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("add_list_to_board",{title:"Add List to Board",description:"Add a new list to the specified board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)"),name:z.string().describe("Name of the new list")}},async({boardId:t,name:e})=>{try{const r=await this.trelloClient.addList(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("archive_list",{title:"Archive List",description:"Send a list to the archive on a specific board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)"),listId:z.string().describe("ID of the list to archive")}},async({boardId:t,listId:e})=>{try{const r=await this.trelloClient.archiveList(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_my_cards",{title:"Get My Cards",description:"Fetch all cards assigned to the current user",inputSchema:{}},async()=>{try{const t=await this.trelloClient.getMyCards();return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("attach_image_to_card",{title:"Attach Image to Card",description:"Attach an image to a card from a URL on a specific board",inputSchema:{boardId:z.string().optional().describe("ID of the Trello board where the card exists (uses default if not provided)"),cardId:z.string().describe("ID of the card to attach the image to"),imageUrl:z.string().describe("URL of the image to attach"),name:z.string().optional().default("Image Attachment").describe('Optional name for the attachment (defaults to "Image Attachment")')}},async({boardId:t,cardId:e,imageUrl:r,name:o})=>{try{const i=await this.trelloClient.attachImageToCard(t,e,r,o);return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("list_boards",{title:"List Boards",description:"List all boards the user has access to",inputSchema:{}},async()=>{try{const t=await this.trelloClient.listBoards();return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("set_active_board",{title:"Set Active Board",description:"Set the active board for future operations",inputSchema:{boardId:z.string().describe("ID of the board to set as active")}},async({boardId:t})=>{try{const e=await this.trelloClient.setActiveBoard(t);return{content:[{type:"text",text:`Successfully set active board to "${e.name}" (${e.id})`}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("list_workspaces",{title:"List Workspaces",description:"List all workspaces the user has access to",inputSchema:{}},async()=>{try{const t=await this.trelloClient.listWorkspaces();return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("set_active_workspace",{title:"Set Active Workspace",description:"Set the active workspace for future operations",inputSchema:{workspaceId:z.string().describe("ID of the workspace to set as active")}},async({workspaceId:t})=>{try{const e=await this.trelloClient.setActiveWorkspace(t);return{content:[{type:"text",text:`Successfully set active workspace to "${e.displayName}" (${e.id})`}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("list_boards_in_workspace",{title:"List Boards in Workspace",description:"List all boards in a specific workspace",inputSchema:{workspaceId:z.string().describe("ID of the workspace to list boards from")}},async({workspaceId:t})=>{try{const e=await this.trelloClient.listBoardsInWorkspace(t);return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_active_board_info",{title:"Get Active Board Info",description:"Get information about the currently active board",inputSchema:{}},async()=>{try{const t=this.trelloClient.activeBoardId;if(!t)return{content:[{type:"text",text:"No active board set"}],isError:!0};const e=await this.trelloClient.getBoardById(t);return{content:[{type:"text",text:JSON.stringify({...e,isActive:!0,activeWorkspaceId:this.trelloClient.activeWorkspaceId||"Not set"},null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_card",{title:"Get Card",description:"Get detailed information about a specific Trello card",inputSchema:{cardId:z.string().describe("ID of the card to fetch"),includeMarkdown:z.boolean().optional().default(!1).describe("Whether to return card description in markdown format (default: false)")}},async({cardId:t,includeMarkdown:e})=>{try{const r=await this.trelloClient.getCard(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_checklist_items",{title:"Get Checklist Items",description:"Get all items from a checklist by name",inputSchema:{name:z.string().describe("Name of the checklist to retrieve items from"),boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)")}},async({name:t,boardId:e})=>{try{const r=await this.trelloClient.getChecklistItems(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("add_checklist_item",{title:"Add Checklist Item",description:"Add a new item to a checklist",inputSchema:{text:z.string().describe("Text content of the checklist item"),checkListName:z.string().describe("Name of the checklist to add the item to"),boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)")}},async({text:t,checkListName:e,boardId:r})=>{try{const o=await this.trelloClient.addChecklistItem(t,e,r);return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("find_checklist_items_by_description",{title:"Find Checklist Items by Description",description:"Search for checklist items containing specific text in their description",inputSchema:{description:z.string().describe("Text to search for in checklist item descriptions"),boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)")}},async({description:t,boardId:e})=>{try{const r=await this.trelloClient.findChecklistItemsByDescription(t,e);return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_acceptance_criteria",{title:"Get Acceptance Criteria",description:'Get all items from the "Acceptance Criteria" checklist',inputSchema:{boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)")}},async({boardId:t})=>{try{const e=await this.trelloClient.getAcceptanceCriteria(t);return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}}),this.server.registerTool("get_checklist_by_name",{title:"Get Checklist by Name",description:"Get a complete checklist with all its items and completion percentage",inputSchema:{name:z.string().describe("Name of the checklist to retrieve"),boardId:z.string().optional().describe("ID of the Trello board (uses default if not provided)")}},async({name:t,boardId:e})=>{try{const r=await this.trelloClient.getChecklistByName(t,e);return r?{content:[{type:"text",text:JSON.stringify(r,null,2)}]}:{content:[{type:"text",text:`Checklist "${t}" not found`}],isError:!0}}catch(t){return{content:[{type:"text",text:`Error: ${t instanceof Error?t.message:"Unknown error occurred"}`}],isError:!0}}})}async run(){const t=new StdioServerTransport;await this.trelloClient.loadConfig().catch(()=>{}),await this.server.connect(t)}}const server=new TrelloServer;server.run().catch(()=>{});
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { TrelloClient } from './trello-client.js';
|
|
6
|
+
import { TrelloHealthEndpoints, HealthEndpointSchemas } from './health/health-endpoints.js';
|
|
7
|
+
class TrelloServer {
|
|
8
|
+
constructor() {
|
|
9
|
+
const apiKey = process.env.TRELLO_API_KEY;
|
|
10
|
+
const token = process.env.TRELLO_TOKEN;
|
|
11
|
+
const defaultBoardId = process.env.TRELLO_BOARD_ID;
|
|
12
|
+
if (!apiKey || !token) {
|
|
13
|
+
throw new Error('TRELLO_API_KEY and TRELLO_TOKEN environment variables are required');
|
|
14
|
+
}
|
|
15
|
+
this.trelloClient = new TrelloClient({
|
|
16
|
+
apiKey,
|
|
17
|
+
token,
|
|
18
|
+
defaultBoardId,
|
|
19
|
+
boardId: defaultBoardId,
|
|
20
|
+
});
|
|
21
|
+
this.healthEndpoints = new TrelloHealthEndpoints(this.trelloClient);
|
|
22
|
+
this.server = new McpServer({
|
|
23
|
+
name: 'trello-server',
|
|
24
|
+
version: '1.0.0',
|
|
25
|
+
});
|
|
26
|
+
this.setupTools();
|
|
27
|
+
this.setupHealthEndpoints();
|
|
28
|
+
// Error handling
|
|
29
|
+
process.on('SIGINT', async () => {
|
|
30
|
+
await this.server.close();
|
|
31
|
+
process.exit(0);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
handleError(error) {
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
setupTools() {
|
|
46
|
+
// Get cards from a specific list
|
|
47
|
+
this.server.registerTool('get_cards_by_list_id', {
|
|
48
|
+
title: 'Get Cards by List ID',
|
|
49
|
+
description: 'Fetch cards from a specific Trello list on a specific board',
|
|
50
|
+
inputSchema: {
|
|
51
|
+
boardId: z
|
|
52
|
+
.string()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
55
|
+
listId: z.string().describe('ID of the Trello list'),
|
|
56
|
+
},
|
|
57
|
+
}, async ({ boardId, listId }) => {
|
|
58
|
+
try {
|
|
59
|
+
const cards = await this.trelloClient.getCardsByList(boardId, listId);
|
|
60
|
+
return {
|
|
61
|
+
content: [{ type: 'text', text: JSON.stringify(cards, null, 2) }],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
return this.handleError(error);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
// Get all lists from a board
|
|
69
|
+
this.server.registerTool('get_lists', {
|
|
70
|
+
title: 'Get Lists',
|
|
71
|
+
description: 'Retrieve all lists from the specified board',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
boardId: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
77
|
+
},
|
|
78
|
+
}, async ({ boardId }) => {
|
|
79
|
+
try {
|
|
80
|
+
const lists = await this.trelloClient.getLists(boardId);
|
|
81
|
+
return {
|
|
82
|
+
content: [{ type: 'text', text: JSON.stringify(lists, null, 2) }],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return this.handleError(error);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
// Get recent activity
|
|
90
|
+
this.server.registerTool('get_recent_activity', {
|
|
91
|
+
title: 'Get Recent Activity',
|
|
92
|
+
description: 'Fetch recent activity on the Trello board',
|
|
93
|
+
inputSchema: {
|
|
94
|
+
boardId: z
|
|
95
|
+
.string()
|
|
96
|
+
.optional()
|
|
97
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
98
|
+
limit: z
|
|
99
|
+
.number()
|
|
100
|
+
.optional()
|
|
101
|
+
.default(10)
|
|
102
|
+
.describe('Number of activities to fetch (default: 10)'),
|
|
103
|
+
},
|
|
104
|
+
}, async ({ boardId, limit }) => {
|
|
105
|
+
try {
|
|
106
|
+
const activity = await this.trelloClient.getRecentActivity(boardId, limit);
|
|
107
|
+
return {
|
|
108
|
+
content: [{ type: 'text', text: JSON.stringify(activity, null, 2) }],
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
return this.handleError(error);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
// Add a new card to a list
|
|
116
|
+
this.server.registerTool('add_card_to_list', {
|
|
117
|
+
title: 'Add Card to List',
|
|
118
|
+
description: 'Add a new card to a specified list on a specific board',
|
|
119
|
+
inputSchema: {
|
|
120
|
+
boardId: z
|
|
121
|
+
.string()
|
|
122
|
+
.optional()
|
|
123
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
124
|
+
listId: z.string().describe('ID of the list to add the card to'),
|
|
125
|
+
name: z.string().describe('Name of the card'),
|
|
126
|
+
description: z.string().optional().describe('Description of the card'),
|
|
127
|
+
dueDate: z.string().optional().describe('Due date for the card (ISO 8601 format)'),
|
|
128
|
+
start: z
|
|
129
|
+
.string()
|
|
130
|
+
.optional()
|
|
131
|
+
.describe('Start date for the card (YYYY-MM-DD format, date only)'),
|
|
132
|
+
labels: z
|
|
133
|
+
.array(z.string())
|
|
134
|
+
.optional()
|
|
135
|
+
.describe('Array of label IDs to apply to the card'),
|
|
136
|
+
},
|
|
137
|
+
}, async (args) => {
|
|
138
|
+
try {
|
|
139
|
+
const card = await this.trelloClient.addCard(args.boardId, args);
|
|
140
|
+
return {
|
|
141
|
+
content: [{ type: 'text', text: JSON.stringify(card, null, 2) }],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return this.handleError(error);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
// Update card details
|
|
149
|
+
this.server.registerTool('update_card_details', {
|
|
150
|
+
title: 'Update Card Details',
|
|
151
|
+
description: "Update an existing card's details on a specific board",
|
|
152
|
+
inputSchema: {
|
|
153
|
+
boardId: z
|
|
154
|
+
.string()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
157
|
+
cardId: z.string().describe('ID of the card to update'),
|
|
158
|
+
name: z.string().optional().describe('New name for the card'),
|
|
159
|
+
description: z.string().optional().describe('New description for the card'),
|
|
160
|
+
dueDate: z.string().optional().describe('New due date for the card (ISO 8601 format)'),
|
|
161
|
+
start: z
|
|
162
|
+
.string()
|
|
163
|
+
.optional()
|
|
164
|
+
.describe('New start date for the card (YYYY-MM-DD format, date only)'),
|
|
165
|
+
dueComplete: z
|
|
166
|
+
.boolean()
|
|
167
|
+
.optional()
|
|
168
|
+
.describe('Mark the due date as complete (true) or incomplete (false)'),
|
|
169
|
+
labels: z.array(z.string()).optional().describe('New array of label IDs for the card'),
|
|
170
|
+
},
|
|
171
|
+
}, async (args) => {
|
|
172
|
+
try {
|
|
173
|
+
const card = await this.trelloClient.updateCard(args.boardId, args);
|
|
174
|
+
return {
|
|
175
|
+
content: [{ type: 'text', text: JSON.stringify(card, null, 2) }],
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
return this.handleError(error);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
// Archive a card
|
|
183
|
+
this.server.registerTool('archive_card', {
|
|
184
|
+
title: 'Archive Card',
|
|
185
|
+
description: 'Send a card to the archive on a specific board',
|
|
186
|
+
inputSchema: {
|
|
187
|
+
boardId: z
|
|
188
|
+
.string()
|
|
189
|
+
.optional()
|
|
190
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
191
|
+
cardId: z.string().describe('ID of the card to archive'),
|
|
192
|
+
},
|
|
193
|
+
}, async ({ boardId, cardId }) => {
|
|
194
|
+
try {
|
|
195
|
+
const card = await this.trelloClient.archiveCard(boardId, cardId);
|
|
196
|
+
return {
|
|
197
|
+
content: [{ type: 'text', text: JSON.stringify(card, null, 2) }],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
return this.handleError(error);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
// Move a card
|
|
205
|
+
this.server.registerTool('move_card', {
|
|
206
|
+
title: 'Move Card',
|
|
207
|
+
description: 'Move a card to a different list, potentially on a different board',
|
|
208
|
+
inputSchema: {
|
|
209
|
+
boardId: z
|
|
210
|
+
.string()
|
|
211
|
+
.optional()
|
|
212
|
+
.describe('ID of the target Trello board (where the listId resides, uses default if not provided)'),
|
|
213
|
+
cardId: z.string().describe('ID of the card to move'),
|
|
214
|
+
listId: z.string().describe('ID of the target list'),
|
|
215
|
+
},
|
|
216
|
+
}, async ({ boardId, cardId, listId }) => {
|
|
217
|
+
try {
|
|
218
|
+
const card = await this.trelloClient.moveCard(boardId, cardId, listId);
|
|
219
|
+
return {
|
|
220
|
+
content: [{ type: 'text', text: JSON.stringify(card, null, 2) }],
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
return this.handleError(error);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
// Add a new list to a board
|
|
228
|
+
this.server.registerTool('add_list_to_board', {
|
|
229
|
+
title: 'Add List to Board',
|
|
230
|
+
description: 'Add a new list to the specified board',
|
|
231
|
+
inputSchema: {
|
|
232
|
+
boardId: z
|
|
233
|
+
.string()
|
|
234
|
+
.optional()
|
|
235
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
236
|
+
name: z.string().describe('Name of the new list'),
|
|
237
|
+
},
|
|
238
|
+
}, async ({ boardId, name }) => {
|
|
239
|
+
try {
|
|
240
|
+
const list = await this.trelloClient.addList(boardId, name);
|
|
241
|
+
return {
|
|
242
|
+
content: [{ type: 'text', text: JSON.stringify(list, null, 2) }],
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
return this.handleError(error);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
// Archive a list
|
|
250
|
+
this.server.registerTool('archive_list', {
|
|
251
|
+
title: 'Archive List',
|
|
252
|
+
description: 'Send a list to the archive on a specific board',
|
|
253
|
+
inputSchema: {
|
|
254
|
+
boardId: z
|
|
255
|
+
.string()
|
|
256
|
+
.optional()
|
|
257
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
258
|
+
listId: z.string().describe('ID of the list to archive'),
|
|
259
|
+
},
|
|
260
|
+
}, async ({ boardId, listId }) => {
|
|
261
|
+
try {
|
|
262
|
+
const list = await this.trelloClient.archiveList(boardId, listId);
|
|
263
|
+
return {
|
|
264
|
+
content: [{ type: 'text', text: JSON.stringify(list, null, 2) }],
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
return this.handleError(error);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
// Get cards assigned to current user
|
|
272
|
+
this.server.registerTool('get_my_cards', {
|
|
273
|
+
title: 'Get My Cards',
|
|
274
|
+
description: 'Fetch all cards assigned to the current user',
|
|
275
|
+
inputSchema: {},
|
|
276
|
+
}, async () => {
|
|
277
|
+
try {
|
|
278
|
+
const cards = await this.trelloClient.getMyCards();
|
|
279
|
+
return {
|
|
280
|
+
content: [{ type: 'text', text: JSON.stringify(cards, null, 2) }],
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
return this.handleError(error);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
// Attach image to card (kept for backward compatibility)
|
|
288
|
+
this.server.registerTool('attach_image_to_card', {
|
|
289
|
+
title: 'Attach Image to Card',
|
|
290
|
+
description: 'Attach an image to a card from a URL on a specific board',
|
|
291
|
+
inputSchema: {
|
|
292
|
+
boardId: z
|
|
293
|
+
.string()
|
|
294
|
+
.optional()
|
|
295
|
+
.describe('ID of the Trello board where the card exists (uses default if not provided)'),
|
|
296
|
+
cardId: z.string().describe('ID of the card to attach the image to'),
|
|
297
|
+
imageUrl: z.string().describe('URL of the image to attach'),
|
|
298
|
+
name: z
|
|
299
|
+
.string()
|
|
300
|
+
.optional()
|
|
301
|
+
.default('Image Attachment')
|
|
302
|
+
.describe('Optional name for the attachment (defaults to "Image Attachment")'),
|
|
303
|
+
},
|
|
304
|
+
}, async ({ boardId, cardId, imageUrl, name }) => {
|
|
305
|
+
try {
|
|
306
|
+
const attachment = await this.trelloClient.attachImageToCard(boardId, cardId, imageUrl, name);
|
|
307
|
+
return {
|
|
308
|
+
content: [{ type: 'text', text: JSON.stringify(attachment, null, 2) }],
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
return this.handleError(error);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
// Attach file to card (generic file attachment)
|
|
316
|
+
this.server.registerTool('attach_file_to_card', {
|
|
317
|
+
title: 'Attach File to Card',
|
|
318
|
+
description: 'Attach any file to a card from a URL on a specific board',
|
|
319
|
+
inputSchema: {
|
|
320
|
+
boardId: z
|
|
321
|
+
.string()
|
|
322
|
+
.optional()
|
|
323
|
+
.describe('ID of the Trello board where the card exists (uses default if not provided)'),
|
|
324
|
+
cardId: z.string().describe('ID of the card to attach the file to'),
|
|
325
|
+
fileUrl: z.string().describe('URL of the file to attach'),
|
|
326
|
+
name: z
|
|
327
|
+
.string()
|
|
328
|
+
.optional()
|
|
329
|
+
.default('File Attachment')
|
|
330
|
+
.describe('Optional name for the attachment (defaults to "File Attachment")'),
|
|
331
|
+
mimeType: z
|
|
332
|
+
.string()
|
|
333
|
+
.optional()
|
|
334
|
+
.describe('Optional MIME type of the file (e.g., "application/pdf", "text/plain", "video/mp4")'),
|
|
335
|
+
},
|
|
336
|
+
}, async ({ boardId, cardId, fileUrl, name, mimeType }) => {
|
|
337
|
+
try {
|
|
338
|
+
const attachment = await this.trelloClient.attachFileToCard(boardId, cardId, fileUrl, name, mimeType);
|
|
339
|
+
return {
|
|
340
|
+
content: [{ type: 'text', text: JSON.stringify(attachment, null, 2) }],
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
return {
|
|
345
|
+
content: [
|
|
346
|
+
{
|
|
347
|
+
type: 'text',
|
|
348
|
+
text: `Error: ${error instanceof Error ? error.message : 'Unknown error occurred'}`,
|
|
349
|
+
},
|
|
350
|
+
],
|
|
351
|
+
isError: true,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
// List all boards
|
|
356
|
+
this.server.registerTool('list_boards', {
|
|
357
|
+
title: 'List Boards',
|
|
358
|
+
description: 'List all boards the user has access to',
|
|
359
|
+
inputSchema: {},
|
|
360
|
+
}, async () => {
|
|
361
|
+
try {
|
|
362
|
+
const boards = await this.trelloClient.listBoards();
|
|
363
|
+
return {
|
|
364
|
+
content: [{ type: 'text', text: JSON.stringify(boards, null, 2) }],
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
return this.handleError(error);
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
// Set active board
|
|
372
|
+
this.server.registerTool('set_active_board', {
|
|
373
|
+
title: 'Set Active Board',
|
|
374
|
+
description: 'Set the active board for future operations',
|
|
375
|
+
inputSchema: {
|
|
376
|
+
boardId: z.string().describe('ID of the board to set as active'),
|
|
377
|
+
},
|
|
378
|
+
}, async ({ boardId }) => {
|
|
379
|
+
try {
|
|
380
|
+
const board = await this.trelloClient.setActiveBoard(boardId);
|
|
381
|
+
return {
|
|
382
|
+
content: [
|
|
383
|
+
{
|
|
384
|
+
type: 'text',
|
|
385
|
+
text: `Successfully set active board to "${board.name}" (${board.id})`,
|
|
386
|
+
},
|
|
387
|
+
],
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
catch (error) {
|
|
391
|
+
return this.handleError(error);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
// List workspaces
|
|
395
|
+
this.server.registerTool('list_workspaces', {
|
|
396
|
+
title: 'List Workspaces',
|
|
397
|
+
description: 'List all workspaces the user has access to',
|
|
398
|
+
inputSchema: {},
|
|
399
|
+
}, async () => {
|
|
400
|
+
try {
|
|
401
|
+
const workspaces = await this.trelloClient.listWorkspaces();
|
|
402
|
+
return {
|
|
403
|
+
content: [{ type: 'text', text: JSON.stringify(workspaces, null, 2) }],
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
catch (error) {
|
|
407
|
+
return this.handleError(error);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
// Create a new board
|
|
411
|
+
this.server.registerTool('create_board', {
|
|
412
|
+
title: 'Create Board',
|
|
413
|
+
description: 'Create a new Trello board optionally within a workspace',
|
|
414
|
+
inputSchema: {
|
|
415
|
+
name: z.string().describe('Name of the board'),
|
|
416
|
+
desc: z.string().optional().describe('Description of the board'),
|
|
417
|
+
idOrganization: z
|
|
418
|
+
.string()
|
|
419
|
+
.min(1)
|
|
420
|
+
.optional()
|
|
421
|
+
.describe('Workspace ID to create the board in (uses active if not provided)'),
|
|
422
|
+
defaultLabels: z
|
|
423
|
+
.boolean()
|
|
424
|
+
.optional()
|
|
425
|
+
.default(true)
|
|
426
|
+
.describe('Create default labels (true by default)'),
|
|
427
|
+
defaultLists: z
|
|
428
|
+
.boolean()
|
|
429
|
+
.optional()
|
|
430
|
+
.default(true)
|
|
431
|
+
.describe('Create default lists (true by default)'),
|
|
432
|
+
},
|
|
433
|
+
}, async ({ name, desc, idOrganization, defaultLabels, defaultLists }) => {
|
|
434
|
+
try {
|
|
435
|
+
const board = await this.trelloClient.createBoard({
|
|
436
|
+
name,
|
|
437
|
+
desc,
|
|
438
|
+
idOrganization,
|
|
439
|
+
defaultLabels,
|
|
440
|
+
defaultLists,
|
|
441
|
+
});
|
|
442
|
+
return {
|
|
443
|
+
content: [{ type: 'text', text: JSON.stringify(board, null, 2) }],
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
catch (error) {
|
|
447
|
+
return this.handleError(error);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
// Set active workspace
|
|
451
|
+
this.server.registerTool('set_active_workspace', {
|
|
452
|
+
title: 'Set Active Workspace',
|
|
453
|
+
description: 'Set the active workspace for future operations',
|
|
454
|
+
inputSchema: {
|
|
455
|
+
workspaceId: z.string().describe('ID of the workspace to set as active'),
|
|
456
|
+
},
|
|
457
|
+
}, async ({ workspaceId }) => {
|
|
458
|
+
try {
|
|
459
|
+
const workspace = await this.trelloClient.setActiveWorkspace(workspaceId);
|
|
460
|
+
return {
|
|
461
|
+
content: [
|
|
462
|
+
{
|
|
463
|
+
type: 'text',
|
|
464
|
+
text: `Successfully set active workspace to "${workspace.displayName}" (${workspace.id})`,
|
|
465
|
+
},
|
|
466
|
+
],
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
catch (error) {
|
|
470
|
+
return this.handleError(error);
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
// List boards in workspace
|
|
474
|
+
this.server.registerTool('list_boards_in_workspace', {
|
|
475
|
+
title: 'List Boards in Workspace',
|
|
476
|
+
description: 'List all boards in a specific workspace',
|
|
477
|
+
inputSchema: {
|
|
478
|
+
workspaceId: z.string().describe('ID of the workspace to list boards from'),
|
|
479
|
+
},
|
|
480
|
+
}, async ({ workspaceId }) => {
|
|
481
|
+
try {
|
|
482
|
+
const boards = await this.trelloClient.listBoardsInWorkspace(workspaceId);
|
|
483
|
+
return {
|
|
484
|
+
content: [{ type: 'text', text: JSON.stringify(boards, null, 2) }],
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
catch (error) {
|
|
488
|
+
return this.handleError(error);
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
// Get active board info
|
|
492
|
+
this.server.registerTool('get_active_board_info', {
|
|
493
|
+
title: 'Get Active Board Info',
|
|
494
|
+
description: 'Get information about the currently active board',
|
|
495
|
+
inputSchema: {},
|
|
496
|
+
}, async () => {
|
|
497
|
+
try {
|
|
498
|
+
const boardId = this.trelloClient.activeBoardId;
|
|
499
|
+
if (!boardId) {
|
|
500
|
+
return {
|
|
501
|
+
content: [{ type: 'text', text: 'No active board set' }],
|
|
502
|
+
isError: true,
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
const board = await this.trelloClient.getBoardById(boardId);
|
|
506
|
+
return {
|
|
507
|
+
content: [
|
|
508
|
+
{
|
|
509
|
+
type: 'text',
|
|
510
|
+
text: JSON.stringify({
|
|
511
|
+
...board,
|
|
512
|
+
isActive: true,
|
|
513
|
+
activeWorkspaceId: this.trelloClient.activeWorkspaceId || 'Not set',
|
|
514
|
+
}, null, 2),
|
|
515
|
+
},
|
|
516
|
+
],
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
catch (error) {
|
|
520
|
+
return this.handleError(error);
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
// Get card details
|
|
524
|
+
this.server.registerTool('get_card', {
|
|
525
|
+
title: 'Get Card',
|
|
526
|
+
description: 'Get detailed information about a specific Trello card',
|
|
527
|
+
inputSchema: {
|
|
528
|
+
cardId: z.string().describe('ID of the card to fetch'),
|
|
529
|
+
includeMarkdown: z
|
|
530
|
+
.boolean()
|
|
531
|
+
.optional()
|
|
532
|
+
.default(false)
|
|
533
|
+
.describe('Whether to return card description in markdown format (default: false)'),
|
|
534
|
+
},
|
|
535
|
+
}, async ({ cardId, includeMarkdown }) => {
|
|
536
|
+
try {
|
|
537
|
+
const card = await this.trelloClient.getCard(cardId, includeMarkdown);
|
|
538
|
+
return {
|
|
539
|
+
content: [{ type: 'text', text: JSON.stringify(card, null, 2) }],
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
catch (error) {
|
|
543
|
+
return this.handleError(error);
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
// Add a comment to a card
|
|
547
|
+
this.server.registerTool('add_comment', {
|
|
548
|
+
title: 'Add Comment to Card',
|
|
549
|
+
description: 'Add the given text as a new comment to the given card',
|
|
550
|
+
inputSchema: {
|
|
551
|
+
cardId: z.string().describe('ID of the card to comment on'),
|
|
552
|
+
text: z.string().describe('The text of the comment to add'),
|
|
553
|
+
},
|
|
554
|
+
}, async ({ cardId, text }) => {
|
|
555
|
+
try {
|
|
556
|
+
const comment = await this.trelloClient.addCommentToCard(cardId, text);
|
|
557
|
+
return {
|
|
558
|
+
content: [{ type: 'text', text: JSON.stringify(comment, null, 2) }],
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
catch (error) {
|
|
562
|
+
return this.handleError(error);
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
// Update a comment to a card
|
|
566
|
+
this.server.registerTool('update_comment', {
|
|
567
|
+
title: 'Update Comment on Card',
|
|
568
|
+
description: 'Update the given comment with the new text',
|
|
569
|
+
inputSchema: {
|
|
570
|
+
commentId: z.string().describe('ID of the comment to change'),
|
|
571
|
+
text: z.string().describe('The new text of the comment'),
|
|
572
|
+
},
|
|
573
|
+
}, async ({ commentId, text }) => {
|
|
574
|
+
try {
|
|
575
|
+
const success = await this.trelloClient.updateCommentOnCard(commentId, text);
|
|
576
|
+
return {
|
|
577
|
+
content: [{ type: 'text', text: success ? 'success' : 'failure' }],
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
catch (error) {
|
|
581
|
+
return this.handleError(error);
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
// Checklist tools
|
|
585
|
+
this.server.registerTool('get_checklist_items', {
|
|
586
|
+
title: 'Get Checklist Items',
|
|
587
|
+
description: 'Get all items from a checklist by name',
|
|
588
|
+
inputSchema: {
|
|
589
|
+
name: z.string().describe('Name of the checklist to retrieve items from'),
|
|
590
|
+
boardId: z
|
|
591
|
+
.string()
|
|
592
|
+
.optional()
|
|
593
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
594
|
+
},
|
|
595
|
+
}, async ({ name, boardId }) => {
|
|
596
|
+
try {
|
|
597
|
+
const items = await this.trelloClient.getChecklistItems(name, boardId);
|
|
598
|
+
return {
|
|
599
|
+
content: [{ type: 'text', text: JSON.stringify(items, null, 2) }],
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
catch (error) {
|
|
603
|
+
return this.handleError(error);
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
this.server.registerTool('add_checklist_item', {
|
|
607
|
+
title: 'Add Checklist Item',
|
|
608
|
+
description: 'Add a new item to a checklist',
|
|
609
|
+
inputSchema: {
|
|
610
|
+
text: z.string().describe('Text content of the checklist item'),
|
|
611
|
+
checkListName: z.string().describe('Name of the checklist to add the item to'),
|
|
612
|
+
boardId: z
|
|
613
|
+
.string()
|
|
614
|
+
.optional()
|
|
615
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
616
|
+
},
|
|
617
|
+
}, async ({ text, checkListName, boardId }) => {
|
|
618
|
+
try {
|
|
619
|
+
const item = await this.trelloClient.addChecklistItem(text, checkListName, boardId);
|
|
620
|
+
return {
|
|
621
|
+
content: [{ type: 'text', text: JSON.stringify(item, null, 2) }],
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
return this.handleError(error);
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
this.server.registerTool('find_checklist_items_by_description', {
|
|
629
|
+
title: 'Find Checklist Items by Description',
|
|
630
|
+
description: 'Search for checklist items containing specific text in their description',
|
|
631
|
+
inputSchema: {
|
|
632
|
+
description: z.string().describe('Text to search for in checklist item descriptions'),
|
|
633
|
+
boardId: z
|
|
634
|
+
.string()
|
|
635
|
+
.optional()
|
|
636
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
637
|
+
},
|
|
638
|
+
}, async ({ description, boardId }) => {
|
|
639
|
+
try {
|
|
640
|
+
const items = await this.trelloClient.findChecklistItemsByDescription(description, boardId);
|
|
641
|
+
return {
|
|
642
|
+
content: [{ type: 'text', text: JSON.stringify(items, null, 2) }],
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
catch (error) {
|
|
646
|
+
return this.handleError(error);
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
this.server.registerTool('get_acceptance_criteria', {
|
|
650
|
+
title: 'Get Acceptance Criteria',
|
|
651
|
+
description: 'Get all items from the "Acceptance Criteria" checklist',
|
|
652
|
+
inputSchema: {
|
|
653
|
+
boardId: z
|
|
654
|
+
.string()
|
|
655
|
+
.optional()
|
|
656
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
657
|
+
},
|
|
658
|
+
}, async ({ boardId }) => {
|
|
659
|
+
try {
|
|
660
|
+
const items = await this.trelloClient.getAcceptanceCriteria(boardId);
|
|
661
|
+
return {
|
|
662
|
+
content: [{ type: 'text', text: JSON.stringify(items, null, 2) }],
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
catch (error) {
|
|
666
|
+
return this.handleError(error);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
this.server.registerTool('get_checklist_by_name', {
|
|
670
|
+
title: 'Get Checklist by Name',
|
|
671
|
+
description: 'Get a complete checklist with all its items and completion percentage',
|
|
672
|
+
inputSchema: {
|
|
673
|
+
name: z.string().describe('Name of the checklist to retrieve'),
|
|
674
|
+
boardId: z
|
|
675
|
+
.string()
|
|
676
|
+
.optional()
|
|
677
|
+
.describe('ID of the Trello board (uses default if not provided)'),
|
|
678
|
+
},
|
|
679
|
+
}, async ({ name, boardId }) => {
|
|
680
|
+
try {
|
|
681
|
+
const checklist = await this.trelloClient.getChecklistByName(name, boardId);
|
|
682
|
+
if (!checklist) {
|
|
683
|
+
return {
|
|
684
|
+
content: [{ type: 'text', text: `Checklist "${name}" not found` }],
|
|
685
|
+
isError: true,
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
return {
|
|
689
|
+
content: [{ type: 'text', text: JSON.stringify(checklist, null, 2) }],
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
catch (error) {
|
|
693
|
+
return this.handleError(error);
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
setupHealthEndpoints() {
|
|
698
|
+
// Basic health check endpoint
|
|
699
|
+
this.server.registerTool('get_health', HealthEndpointSchemas.basicHealth, async () => {
|
|
700
|
+
try {
|
|
701
|
+
return await this.healthEndpoints.getBasicHealth();
|
|
702
|
+
}
|
|
703
|
+
catch (error) {
|
|
704
|
+
return this.handleError(error);
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
// Detailed health diagnostic endpoint
|
|
708
|
+
this.server.registerTool('get_health_detailed', HealthEndpointSchemas.detailedHealth, async () => {
|
|
709
|
+
try {
|
|
710
|
+
return await this.healthEndpoints.getDetailedHealth();
|
|
711
|
+
}
|
|
712
|
+
catch (error) {
|
|
713
|
+
return this.handleError(error);
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
// Metadata consistency check endpoint
|
|
717
|
+
this.server.registerTool('get_health_metadata', HealthEndpointSchemas.metadataHealth, async () => {
|
|
718
|
+
try {
|
|
719
|
+
return await this.healthEndpoints.getMetadataHealth();
|
|
720
|
+
}
|
|
721
|
+
catch (error) {
|
|
722
|
+
return this.handleError(error);
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
// Performance metrics endpoint
|
|
726
|
+
this.server.registerTool('get_health_performance', HealthEndpointSchemas.performanceHealth, async () => {
|
|
727
|
+
try {
|
|
728
|
+
return await this.healthEndpoints.getPerformanceHealth();
|
|
729
|
+
}
|
|
730
|
+
catch (error) {
|
|
731
|
+
return this.handleError(error);
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
// System repair endpoint
|
|
735
|
+
this.server.registerTool('perform_system_repair', HealthEndpointSchemas.repair, async () => {
|
|
736
|
+
try {
|
|
737
|
+
return await this.healthEndpoints.performRepair();
|
|
738
|
+
}
|
|
739
|
+
catch (error) {
|
|
740
|
+
return this.handleError(error);
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
async run() {
|
|
745
|
+
const transport = new StdioServerTransport();
|
|
746
|
+
// Load configuration before starting the server
|
|
747
|
+
await this.trelloClient.loadConfig().catch(() => {
|
|
748
|
+
// Continue with default config if loading fails
|
|
749
|
+
});
|
|
750
|
+
await this.server.connect(transport);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
const server = new TrelloServer();
|
|
754
|
+
server.run().catch(() => {
|
|
755
|
+
// Silently handle errors to avoid interfering with MCP protocol
|
|
756
|
+
});
|
|
757
|
+
//# sourceMappingURL=index.js.map
|