Skip to main content
Glama

move-card

Move Trello cards between lists or reposition them within a list using card and destination IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdYesID of the card to move
listIdYesID of the destination list
positionNoPosition in the list (e.g. "top", "bottom")

Implementation Reference

  • The asynchronous handler function that executes the logic to move a Trello card by sending a PUT request to the Trello API, updating the idList and position.
    async ({ cardId, listId, position = 'bottom' }) => { try { const response = await fetch( `https://api.trello.com/1/cards/${cardId}?key=${trelloApiKey}&token=${trelloApiToken}`, { 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, }; } }
  • Zod input schema defining parameters for the move-card tool: cardId (required string), listId (required string), position (optional string).
    { 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/index.ts:241-284 (registration)
    The server.tool registration call that defines and registers the 'move-card' tool with its name, input schema, and handler 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 { const response = await fetch( `https://api.trello.com/1/cards/${cardId}?key=${trelloApiKey}&token=${trelloApiToken}`, { 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, }; } } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/praveencs87/trello-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server