move-list-to-board
Move a Trello list with all its cards to a different board for better organization or project restructuring.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listId | Yes | ID of the list to move | |
| boardId | Yes | ID of the destination board |
Implementation Reference
- src/tools/lists.ts:229-275 (handler)The handler function that executes the tool logic by sending a PUT request to the Trello API to move the specified list to the destination board, handling credentials check, API call, response parsing, and error handling.async ({ listId, boardId }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/lists/${listId}/idBoard?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ value: boardId, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error moving list to board: ${error}`, }, ], isError: true, }; } }
- src/tools/lists.ts:226-228 (schema)Zod schema defining the input parameters: listId and boardId.listId: z.string().describe('ID of the list to move'), boardId: z.string().describe('ID of the destination board'), },
- src/tools/lists.ts:224-276 (registration)The server.tool call that registers the 'move-list-to-board' tool, specifying its name, input schema, and handler function.'move-list-to-board', { listId: z.string().describe('ID of the list to move'), boardId: z.string().describe('ID of the destination board'), }, async ({ listId, boardId }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/lists/${listId}/idBoard?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ value: boardId, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error moving list to board: ${error}`, }, ], isError: true, }; } } );