Skip to main content
Glama

create-cards

Create multiple cards on Trello boards to organize tasks and projects. Specify card names, descriptions, and target lists to manage workflow efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardsYes

Implementation Reference

  • Handler function that creates multiple Trello cards in parallel using the Trello API, returns JSON results or error.
    async ({ cards }) => { try { const results = await Promise.all( cards.map(async (card) => { const response = await fetch( `https://api.trello.com/1/cards?key=${trelloApiKey}&token=${trelloApiToken}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ name: card.name, desc: card.description || '', idList: card.listId, pos: 'bottom', }), } ); return await response.json(); }) ); return { content: [ { type: 'text', text: JSON.stringify(results), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error creating cards: ${error}`, }, ], isError: true, }; } }
  • Zod input schema defining an array of card objects, each with required name and listId, optional description.
    { cards: z.array( z.object({ name: z.string(), description: z.string().optional(), listId: z.string(), }) ), },
  • src/index.ts:186-239 (registration)
    Registration of the 'create-cards' tool on the MCP server, including schema and inline handler.
    server.tool( 'create-cards', { cards: z.array( z.object({ name: z.string(), description: z.string().optional(), listId: z.string(), }) ), }, async ({ cards }) => { try { const results = await Promise.all( cards.map(async (card) => { const response = await fetch( `https://api.trello.com/1/cards?key=${trelloApiKey}&token=${trelloApiToken}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ name: card.name, desc: card.description || '', idList: card.listId, pos: 'bottom', }), } ); return await response.json(); }) ); return { content: [ { type: 'text', text: JSON.stringify(results), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error creating cards: ${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