move-list-to-board
Transfer a Trello list to a new board by specifying the list ID and destination board ID, enabling organized project management and resource allocation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | ID of the destination board | |
| listId | Yes | ID of the list to move |
Implementation Reference
- src/tools/lists.ts:229-275 (handler)The core handler function that executes the tool by performing a PUT request to the Trello API to update the board ID of the specified list.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:225-228 (schema)Zod input schema defining the required parameters listId and boardId for the tool.{ listId: z.string().describe('ID of the list to move'), boardId: z.string().describe('ID of the destination board'), },
- src/tools/lists.ts:223-276 (registration)Local registration of the 'move-list-to-board' tool using server.tool() within the registerListsTools function.server.tool( '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, }; } } );
- src/index.ts:89-89 (registration)Top-level call to registerListsTools which includes the 'move-list-to-board' tool registration.registerListsTools(server, credentials);