Skip to main content
Glama

add_card_to_list

Create and add a new card to a specified list in Trello, including optional details like description, due date, and labels, for organized task management.

Instructions

Add a new card to a specified list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the card
dueDateNoDue date for the card (ISO 8601 format)
labelsNoArray of label IDs to apply to the card
listIdYesID of the list to add the card to
nameYesName of the card

Implementation Reference

  • Core implementation of adding a card to a Trello list via API POST to /cards endpoint with listId, name, etc.
    async addCard(params: { listId: string; name: string; description?: string; dueDate?: string; labels?: string[]; }): Promise<TrelloCard> { return this.handleRequest(async () => { const response = await this.axiosInstance.post('/cards', { idList: params.listId, name: params.name, desc: params.description, due: params.dueDate, idLabels: params.labels, }); return response.data; }); }
  • Input validation function for add_card_to_list tool parameters.
    export function validateAddCardRequest(args: Record<string, unknown>): { listId: string; name: string; description?: string; dueDate?: string; labels?: string[]; } { if (!args.listId || !args.name) { throw new McpError(ErrorCode.InvalidParams, 'listId and name are required'); } return { listId: validateString(args.listId, 'listId'), name: validateString(args.name, 'name'), description: validateOptionalString(args.description), dueDate: validateOptionalString(args.dueDate), labels: validateOptionalStringArray(args.labels), }; }
  • src/index.ts:98-130 (registration)
    MCP tool registration including name, description, and input schema for 'add_card_to_list'.
    { name: 'add_card_to_list', description: 'Add a new card to a specified list', inputSchema: { type: 'object', properties: { listId: { type: 'string', description: 'ID of the list to add the card to', }, name: { type: 'string', description: 'Name of the card', }, description: { type: 'string', description: 'Description of the card', }, dueDate: { type: 'string', description: 'Due date for the card (ISO 8601 format)', }, labels: { type: 'array', items: { type: 'string', }, description: 'Array of label IDs to apply to the card', }, }, required: ['listId', 'name'], }, },
  • MCP CallToolRequest handler case that validates input, calls TrelloClient.addCard, and formats response.
    case 'add_card_to_list': { const validArgs = validateAddCardRequest(args); const card = await this.trelloClient.addCard(validArgs); return { content: [{ type: 'text', text: JSON.stringify(card, null, 2) }], }; }
  • Type definition for TrelloCard, used as return type for addCard operation.
    export interface TrelloCard { id: string; name: string; desc: string; due: string | null; idList: string; idLabels: string[]; closed: boolean; url: string; dateLastActivity: string; }

Other Tools

Related Tools

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/diegofornalha/mcp-server-trello'

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