Skip to main content
Glama

create-card

Add a new card to a Trello list by specifying the card name and list ID. This tool enables AI assistants to create task cards within Trello boards for project management automation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
descriptionNo
listIdYes

Implementation Reference

  • The asynchronous handler function that executes the tool logic: sends a POST request to the Trello API to create a new card with the given name, description, and list ID.
    async ({ name, description, listId }) => { try { 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, desc: description || '', idList: listId, pos: 'bottom', }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error creating card: ${error}`, }, ], isError: true, }; } }
  • Zod schema for input validation: requires 'name' and 'listId' strings, optional 'description' string.
    { name: z.string(), description: z.string().optional(), listId: z.string(), },
  • src/index.ts:79-124 (registration)
    MCP server.tool call that registers the 'create-card' tool with its name, input schema, and handler function.
    server.tool( 'create-card', { name: z.string(), description: z.string().optional(), listId: z.string(), }, async ({ name, description, listId }) => { try { 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, desc: description || '', idList: listId, pos: 'bottom', }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error creating 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