feat: implement Trello list management

Add 4 list management tools extending the Trello client:
- trello_create_list — create a new list on a board
- trello_rename_list — rename an existing list
- trello_archive_list — archive a list
- trello_move_list — move a list to a new position

Also update the auth spec doc to reflect the PR #5 review fixes
(TypedDict contracts, updated disconnect message).

Issue: #3
This commit is contained in:
Marko (Hermes Implementer)
2026-05-26 22:37:02 +00:00
parent f4bff86b70
commit f2d65f8914
7 changed files with 530 additions and 3 deletions
+88
View File
@@ -0,0 +1,88 @@
# Trello Plugin — Manage Trello Lists
**Feature:** US: Manage Trello Lists
**Issue:** #3
**Branch:** `feature/manage-lists`
## Overview
Extends the Trello plugin with list management capabilities: create, rename, archive, and reposition lists on a Trello board.
## Design Decisions
- **Lists require a board context** — Creating a list needs a board ID. Other operations (rename, archive, move) use the list's Trello ID which is globally unique.
- **Position parameter** — Uses Trello's `pos` field which accepts `"top"`, `"bottom"`, or a positive number.
## Tools
### `trello_create_list`
Create a new list on a board.
**Parameters:**
| Param | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | string | Yes | List name |
| `board_id` | string | Yes | Board ID or name |
| `pos` | string | No | Position: `"top"`, `"bottom"`, or number (default: `"bottom"`) |
**Returns:**
```json
{"success": true, "list": {"id": "l1", "name": "My List", "id_board": "b1"}}
```
### `trello_rename_list`
Rename an existing list.
**Parameters:**
| Param | Type | Required | Description |
|-------|------|----------|-------------|
| `list_id` | string | Yes | List ID |
| `name` | string | Yes | New name |
**Returns:**
```json
{"success": true, "list": {"id": "l1", "name": "Renamed List"}}
```
### `trello_archive_list`
Archive a list.
**Parameters:**
| Param | Type | Required | Description |
|-------|------|----------|-------------|
| `list_id` | string | Yes | List ID |
**Returns:**
```json
{"success": true, "message": "List 'My List' archived."}
```
### `trello_move_list`
Move a list to a different position.
**Parameters:**
| Param | Type | Required | Description |
|-------|------|----------|-------------|
| `list_id` | string | Yes | List ID |
| `pos` | string | Yes | Position: `"top"`, `"bottom"`, or a number |
**Returns:**
```json
{"success": true, "message": "List 'My List' moved."}
```
## Trello API Endpoints
| Purpose | Method | Endpoint |
|---------|--------|----------|
| Create list | POST | `/1/lists` |
| Update list (rename, archive, move) | PUT | `/1/lists/{id}` |
## Error Handling
- List not found → clear error message
- Board not found when creating → propagate board lookup error
+9 -2
View File
@@ -64,7 +64,9 @@ Fetches and returns all Trello boards accessible to the authenticated user.
### 3. `trello_disconnect`
Clears the stored credentials from memory. Note: this does not revoke the Trello token — the user must invalidate it via Trello's settings if needed.
Clears the stored credentials from memory. Since credentials are stored in environment variables, the next tool call will automatically re-read them and reconnect. To fully disconnect, also unset ``TRELLO_API_KEY`` and ``TRELLO_TOKEN`` from the Hermes profile config.
Note: this does NOT revoke the Trello token — the user must invalidate it via Trello's settings if needed.
**Parameters:** None
@@ -72,7 +74,7 @@ Clears the stored credentials from memory. Note: this does not revoke the Trello
```json
{
"success": true,
"message": "Trello credentials cleared. Set TRELLO_API_KEY and TRELLO_TOKEN again to reconnect."
"message": "Trello credentials cleared from memory. Next tool call will re-read TRELLO_API_KEY and TRELLO_TOKEN from environment and reconnect automatically."
}
```
@@ -82,6 +84,9 @@ Clears the stored credentials from memory. Note: this does not revoke the Trello
```python
class TrelloClient:
api_key: str
token: str
def __init__(self, api_key: str | None = None, token: str | None = None)
def verify_credentials(self) -> dict
@@ -89,6 +94,8 @@ class TrelloClient:
def disconnect(self) -> dict
```
The client uses `TypedDict` response contracts (`SuccessResponse`/`ErrorResponse`) with a `TypeGuard` helper `_is_success()` for type-safe narrowing. Internal helpers include `_request()`, `_get()`, `_post()`, `_put()`, `_check_credentials()`, and `_handle_http_error()`.
### Trello API Endpoints Used
| Purpose | Method | Endpoint | Docs |