move-card
Relocate Trello cards to specific lists and positions using this tool to streamline task management and maintain organized workflows.
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)Handler function that moves a Trello card to another list using PUT /cards/{id} with idList and pos parameters.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 schema defining inputs 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)Direct registration of the 'move-card' tool using server.tool() inside registerCardsTools function.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:90-90 (registration)Invocation of registerCardsTools which registers the 'move-card' tool among others.registerCardsTools(server, credentials);