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
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | Yes | Trello API key (automatically provided by Claude.app from your stored credentials) | |
| token | Yes | Trello API token (automatically provided by Claude.app from your stored credentials) | |
| name | Yes | Name/title of the card (what the task or item is about) | |
| desc | No | Optional detailed description of the card | |
| idList | Yes | ID of the list where the card will be created (you can get this from get_lists) | |
| pos | No | Position in the list: "top", "bottom", or specific number | |
| due | No | Optional due date for the card (ISO 8601 format, e.g., "2024-12-31T23:59:59Z") | |
| idMembers | No | Optional array of member IDs to assign to the card | |
| idLabels | No | Optional array of label IDs to categorize the card |
Implementation Reference
- src/tools/cards.ts:72-132 (handler)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 }; } } - src/tools/cards.ts:12-70 (registration)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'] } };