Skip to main content
Glama

create-card

Add new cards to Trello lists to organize tasks and projects, specifying name, description, and target list for structured project management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the card
descriptionNoDescription of the card
listIdYesID of the list to create the card in

Implementation Reference

  • The asynchronous handler function that executes the logic to create a new Trello card by making a POST request to the Trello API.
    async ({ name, description, listId }) => { try { 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, 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 defining the input parameters for the create-card tool: name (required), description (optional), listId (required).
    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'), },
  • The server.tool() call that registers the 'create-card' tool with its schema and handler function.
    server.tool( 'create-card', { 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 ({ name, description, listId }) => { try { 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, 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, }; } } );
  • src/index.ts:90-90 (registration)
    Call to registerCardsTools which includes the create-card tool registration.
    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