move-card
Move Trello cards between lists to organize tasks and manage workflows. Specify card ID, destination list ID, and optional position.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardId | Yes | ID of the card to move | |
| listId | Yes | ID of the destination list | |
| position | No | Position in the list (e.g. "top", "bottom") |
Implementation Reference
- src/tools/cards.ts:122-169 (handler)The async handler function for the 'move-card' tool that sends a PUT request to the Trello API to move the specified card to a new list, handling credentials check and errors.async ({ cardId, listId, position = 'bottom' }) => { 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/cards/${cardId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ idList: listId, pos: position, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error moving card: ${error}`, }, ], isError: true, }; } }
- src/tools/cards.ts:117-121 (schema)Zod input schema defining parameters for the 'move-card' tool: cardId (required), listId (required), position (optional).{ cardId: z.string().describe('ID of the card to move'), listId: z.string().describe('ID of the destination list'), position: z.string().optional().describe('Position in the list (e.g. "top", "bottom")'), },
- src/tools/cards.ts:115-170 (registration)The server.tool call that registers the 'move-card' tool, including its name, schema, and handler function within the registerCardsTools module.server.tool( 'move-card', { cardId: z.string().describe('ID of the card to move'), listId: z.string().describe('ID of the destination list'), position: z.string().optional().describe('Position in the list (e.g. "top", "bottom")'), }, async ({ cardId, listId, position = 'bottom' }) => { 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/cards/${cardId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ idList: listId, pos: position, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error moving card: ${error}`, }, ], isError: true, }; } } );
- src/index.ts:88-92 (registration)Invocation of registerCardsTools in the main index.ts, which triggers the registration of the 'move-card' tool among other cards tools on the MCP server.registerBoardsTools(server, credentials); registerListsTools(server, credentials); registerCardsTools(server, credentials); registerLabelsTools(server, credentials); registerActionsTools(server, credentials);