Repository navigation
Conversation
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 <clio-agent@sisyphuslabs.ai>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for specifying a card’s position (pos) at creation time, exposing this through the MCP tools and forwarding it to Trello’s POST /cards so callers can create cards at the top/bottom (or a numeric position) without a follow-up update call.
Changes:
- Adds optional
possupport toTrelloClient.addCard()and forwards it toPOST /cards. - Adds per-card
possupport toTrelloClient.batchAddCards()(sequential creation). - Extends the
add_card_to_listandadd_cards_to_listMCP tool input schemas to acceptpos.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/trello-client.ts | Forwards pos through single-card creation and batch card creation APIs. |
| src/index.ts | Exposes pos on the MCP tool schemas for single and batch card creation. |
Suppressed comments (2)
src/index.ts:1611
- Same validation issue for batch card creation:
posisz.union([z.string(), z.number()])but the description restricts it to "top"/"bottom" or a positive number. Consider usingz.enum(['top','bottom'])for strings plusz.number().positive()for numeric positions to fail fast with a clearer error.
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)'
),
src/trello-client.ts:1237
batchAddCardssimilarly types each card'sposasstring | number. Consider narrowing this tonumber | 'top' | 'bottom'(or a sharedTrelloPostype) to match Trello semantics and keep the batch API consistent with single-card creation.
name: string;
description?: string;
dueDate?: string;
start?: string;
labels?: string[];
pos?: string | number;
}>
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+215
to
+220
| 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)' | ||
| ), |
Comment on lines
381
to
386
| dueDate?: string; | ||
| dueReminder?: number | null; | ||
| start?: string; | ||
| labels?: string[]; | ||
| pos?: string | number; | ||
| } |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
postoadd_card_to_list("top"/"bottom"/ positive number), forwarded toPOST /cardspostoadd_cards_to_list(batch)update_card_details/move_cardpos semantics; omittedposkeeps the Trello default (bottom)Motivation
There was no way to create a card at the top of a list in one call — the only workaround was create +
update_card_details(pos)(two API calls per card, worse with batch).Test plan
npx tsc --noEmitcleanaddCard({ pos: 'top' })andbatchAddCards([{ pos: 'top' }])both place the new card at the top of the list