Skip to main content
Glama

create-cards

Generate multiple Trello cards in specified lists using a structured JSON input. Streamline project management by automating card creation with this integration tool in the Advanced Trello MCP Server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardsYes

Implementation Reference

  • Handler function that creates multiple Trello cards in parallel using Promise.all on API POST requests to https://api.trello.com/1/cards, returns JSON array of results or error message.
    async ({ cards }) => { try { const results = await Promise.all( cards.map(async (card) => { const response = await fetch( `https://api.trello.com/1/cards?key=${credentials.apiKey}&token=${credentials.apiToken}`, { 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 schema for the input parameter 'cards', an array of objects each containing 'name' (required string), 'description' (optional string), and 'listId' (required string).
    { cards: z.array( z.object({ name: z.string().describe('Name of the card'), description: z.string().optional().describe('Description of the card'), listId: z.string().describe('ID of the list to create the card in'), }) ), },
  • Direct registration of the 'create-cards' tool using server.tool(name, inputSchema, handlerFunction) inside the registerCardsTools function.
    server.tool( 'create-cards', { cards: z.array( z.object({ name: z.string().describe('Name of the card'), description: z.string().optional().describe('Description of the card'), listId: z.string().describe('ID of the list to create the card in'), }) ), }, async ({ cards }) => { try { const results = await Promise.all( cards.map(async (card) => { const response = await fetch( `https://api.trello.com/1/cards?key=${credentials.apiKey}&token=${credentials.apiToken}`, { 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, }; } } );
  • src/index.ts:90-90 (registration)
    Top-level call to registerCardsTools(server, credentials) in the main server setup file, which registers the 'create-cards' tool among other cards tools.
    registerCardsTools(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