Skip to main content
Glama

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
NameRequiredDescriptionDefault
cardIdYesID of the card to move
listIdYesID of the destination list
positionNoPosition in the list (e.g. "top", "bottom")

Implementation Reference

  • 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, }; } }
  • 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")'), },
  • 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);

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/adriangrahldev/advanced-trello-mcp-server'

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