Skip to main content
Glama

create_card

Add tasks, ideas, or items to Trello lists to organize your workflow. Create cards with titles, descriptions, due dates, assignments, and labels for project management.

Instructions

Create a new card in a Trello list. Use this to add tasks, ideas, or items to your workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyYesTrello API key (automatically provided by Claude.app from your stored credentials)
tokenYesTrello API token (automatically provided by Claude.app from your stored credentials)
nameYesName/title of the card (what the task or item is about)
descNoOptional detailed description of the card
idListYesID of the list where the card will be created (you can get this from get_lists)
posNoPosition in the list: "top", "bottom", or specific number
dueNoOptional due date for the card (ISO 8601 format, e.g., "2024-12-31T23:59:59Z")
idMembersNoOptional array of member IDs to assign to the card
idLabelsNoOptional array of label IDs to categorize the card

Implementation Reference

  • The main handler for the 'create_card' tool, responsible for validating input, calling the Trello client, and formatting the response.
    export async function handleCreateCard(args: unknown) {
      try {
        const cardData = validateCreateCard(args);
        const { apiKey, token, ...createData } = cardData;
        
        const client = new TrelloClient({ apiKey, token });
        const response = await client.createCard(createData);
        const card = response.data;
        
        const result = {
          summary: `Created card: ${card.name}`,
          card: {
            id: card.id,
            name: card.name,
            description: card.desc || 'No description',
            url: card.shortUrl,
            listId: card.idList,
            boardId: card.idBoard,
            position: card.pos,
            due: card.due,
            closed: card.closed,
            labels: card.labels?.map(label => ({
              id: label.id,
              name: label.name,
              color: label.color
            })) || [],
            members: card.members?.map(member => ({
              id: member.id,
              fullName: member.fullName,
              username: member.username
            })) || []
          },
          rateLimit: response.rateLimit
        };
        
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof z.ZodError 
          ? formatValidationError(error)
          : error instanceof Error 
            ? error.message 
            : 'Unknown error occurred';
            
        return {
          content: [
            {
              type: 'text' as const,
              text: `Error creating card: ${errorMessage}`
            }
          ],
          isError: true
        };
      }
    }
  • The definition of the 'create_card' tool, including its schema and description.
    export const createCardTool: Tool = {
      name: 'create_card',
      description: 'Create a new card in a Trello list. Use this to add tasks, ideas, or items to your workflow.',
      inputSchema: {
        type: 'object',
        properties: {
          apiKey: {
            type: 'string',
            description: 'Trello API key (automatically provided by Claude.app from your stored credentials)'
          },
          token: {
            type: 'string',
            description: 'Trello API token (automatically provided by Claude.app from your stored credentials)'
          },
          name: {
            type: 'string',
            description: 'Name/title of the card (what the task or item is about)'
          },
          desc: {
            type: 'string',
            description: 'Optional detailed description of the card'
          },
          idList: {
            type: 'string',
            description: 'ID of the list where the card will be created (you can get this from get_lists)',
            pattern: '^[a-f0-9]{24}$'
          },
          pos: {
            oneOf: [
              { type: 'number', minimum: 0 },
              { type: 'string', enum: ['top', 'bottom'] }
            ],
            description: 'Position in the list: "top", "bottom", or specific number'
          },
          due: {
            type: 'string',
            format: 'date-time',
            description: 'Optional due date for the card (ISO 8601 format, e.g., "2024-12-31T23:59:59Z")'
          },
          idMembers: {
            type: 'array',
            items: {
              type: 'string',
              pattern: '^[a-f0-9]{24}$'
            },
            description: 'Optional array of member IDs to assign to the card'
          },
          idLabels: {
            type: 'array',
            items: {
              type: 'string',
              pattern: '^[a-f0-9]{24}$'
            },
            description: 'Optional array of label IDs to categorize the card'
          }
        },
        required: ['apiKey', 'token', 'name', 'idList']
      }
    };

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/kocakli/Trello-Desktop-MCP'

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