From 4b051923b3447c1bab8abdb20b0342622bc8b45c Mon Sep 17 00:00:00 2001 From: alexue4 Date: Fri, 14 Aug 2026 20:56:20 +0300 Subject: [PATCH] feat(cards): support pos parameter when creating cards Add optional pos to add_card_to_list and per-card pos to add_cards_to_list, forwarded to POST /cards. Accepts "top", "bottom", or a positive number, matching the existing update_card_details/move_card behavior. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/index.ts | 12 ++++++++++++ src/trello-client.ts | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/index.ts b/src/index.ts index ee36dbdd..0c168139 100644 --- a/src/index.ts +++ b/src/index.ts @@ -212,6 +212,12 @@ class TrelloServer { .array(z.string()) .optional() .describe('Array of label IDs to apply to the card'), + pos: z + .union([z.string(), z.number()]) + .optional() + .describe( + 'Position of the card in the list. Accepts "top", "bottom", or a positive number. Defaults to "bottom" (Trello API default)' + ), }, }, async args => { @@ -1597,6 +1603,12 @@ class TrelloServer { .array(z.string()) .optional() .describe('Array of label IDs to apply to the card'), + pos: z + .union([z.string(), z.number()]) + .optional() + .describe( + 'Position of the card in the list. Accepts "top", "bottom", or a positive number. Defaults to "bottom" (Trello API default)' + ), }) ) .describe('Array of cards to create (max 50)'), diff --git a/src/trello-client.ts b/src/trello-client.ts index 127b2144..00be8817 100644 --- a/src/trello-client.ts +++ b/src/trello-client.ts @@ -382,6 +382,7 @@ export class TrelloClient { dueReminder?: number | null; start?: string; labels?: string[]; + pos?: string | number; } ): Promise { return this.handleRequest(async () => { @@ -393,6 +394,7 @@ export class TrelloClient { dueReminder: params.dueReminder, start: params.start, idLabels: params.labels, + pos: params.pos, }); return response.data; }); @@ -1231,6 +1233,7 @@ export class TrelloClient { dueDate?: string; start?: string; labels?: string[]; + pos?: string | number; }> ): Promise<{ created: TrelloCard[]; errors: Array<{ index: number; name: string; error: string }> }> { if (cards.length > TrelloClient.BATCH_ADD_CARDS_LIMIT) { @@ -1250,6 +1253,7 @@ export class TrelloClient { dueDate: cards[i].dueDate, start: cards[i].start, labels: cards[i].labels, + pos: cards[i].pos, }); created.push(result); } catch (error) {