trello_create_check_item
Add a check item to a Trello checklist with due date and member assignment. Supports position and checked state.
Instructions
Add an item to a checklist. Supports due dates and member assignment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | No | Trello API key (optional if TRELLO_API_KEY env var is set) | |
| token | No | Trello API token (optional if TRELLO_TOKEN env var is set) | |
| checklistId | Yes | ID of the checklist to add the item to | |
| name | Yes | Text of the check item | |
| pos | No | Position: "top", "bottom", or a number | |
| checked | No | Whether the item should start as checked | |
| due | No | Due date in ISO 8601 format (e.g., "2024-12-31T23:59:59Z") | |
| idMember | No | ID of the member to assign |
Implementation Reference
- src/tools/checklists.ts:637-671 (handler)Handler function that executes the 'trello_create_check_item' tool logic. Validates input, calls TrelloClient.createCheckItem(), and returns the created check item with rate limit info.
export async function handleTrelloCreateCheckItem(args: unknown) { try { const { credentials, params } = extractCredentials(args); const { checklistId, name, pos, checked, due, idMember} = validateCreateCheckItem(params); const client = new TrelloClient(credentials); const response = await client.createCheckItem(checklistId, { name, ...(pos !== undefined && { pos }), ...(checked !== undefined && { checked }), ...(due && { due }), ...(idMember && { idMember }) }); const item = response.data; return { content: [{ type: 'text' as const, text: JSON.stringify({ summary: `Created check item "${item.name}"`, checkItem: { id: item.id, name: item.name, state: item.state, pos: item.pos, due: item.due, idMember: item.idMember }, rateLimit: response.rateLimit }, null, 2) }] }; } catch (error) { return handleToolError(error, 'creating check item'); } - src/tools/checklists.ts:85-96 (schema)Zod validation schema for the create check item operation. Validates checklistId, name, pos, checked, due, and idMember fields.
const validateCreateCheckItem = (args: unknown) => { const schema = z.object({ checklistId: trelloIdSchema, name: z.string().min(1, 'Check item name is required'), pos: z.union([z.string(), z.number()]).optional(), checked: z.boolean().optional(), due: z.string().optional(), idMember: trelloIdSchema.optional() }); return schema.parse(args); }; - src/types/trello.ts:172-178 (schema)TypeScript interface for the create check item API request payload. Defines name, pos, checked, due, and idMember fields.
export interface CreateCheckItemRequest { name: string; pos?: string | number; checked?: boolean; due?: string; idMember?: string; } - src/tools/checklists.ts:286-303 (registration)Tool definition with name 'trello_create_check_item', description, and inputSchema (OpenAPI-style). Used to register the tool with the MCP server.
export const trelloCreateCheckItemTool: Tool = { name: 'trello_create_check_item', description: 'Add an item to a checklist. Supports due dates and member assignment.', inputSchema: { type: 'object', properties: { apiKey: { type: 'string', description: 'Trello API key (optional if TRELLO_API_KEY env var is set)' }, token: { type: 'string', description: 'Trello API token (optional if TRELLO_TOKEN env var is set)' }, checklistId: { type: 'string', description: 'ID of the checklist to add the item to' }, name: { type: 'string', description: 'Text of the check item', minLength: 1 }, pos: { oneOf: [{ type: 'string', enum: ['top', 'bottom'] }, { type: 'number', minimum: 0 }], description: 'Position: "top", "bottom", or a number' }, checked: { type: 'boolean', description: 'Whether the item should start as checked', default: false }, due: { type: 'string', description: 'Due date in ISO 8601 format (e.g., "2024-12-31T23:59:59Z")', format: 'date-time' }, idMember: { type: 'string', description: 'ID of the member to assign' } }, required: ['checklistId', 'name'] } }; - src/trello/client.ts:886-895 (helper)TrelloClient.createCheckItem() - Makes the actual HTTP POST request to Trello API /checklists/{checklistId}/checkItems to create a check item.
async createCheckItem(checklistId: string, data: CreateCheckItemRequest): Promise<TrelloApiResponse<TrelloCheckItem>> { return this.makeRequest<TrelloCheckItem>( `/checklists/${checklistId}/checkItems`, { method: 'POST', body: JSON.stringify(data) }, `Create check item "${data.name}" on checklist ${checklistId}` ); }