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:
@@ -175,6 +175,91 @@ def trello_board_details(board_id: str) -> str:
|
||||
return _respond(result)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Tools — List Management
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def trello_create_list(name: str, board_id: str, pos: str = "bottom") -> str:
|
||||
"""Create a new list on a Trello board.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
The name for the new list.
|
||||
board_id : str
|
||||
Board ID or name.
|
||||
pos : str, optional
|
||||
Position: ``"top"``, ``"bottom"``, or a number (default: ``"bottom"``).
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
JSON with list details on success.
|
||||
"""
|
||||
client = _get_client()
|
||||
result = client.create_list(name=name, board_id=board_id, pos=pos)
|
||||
return _respond(result)
|
||||
|
||||
|
||||
def trello_rename_list(list_id: str, name: str) -> str:
|
||||
"""Rename an existing list.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
list_id : str
|
||||
Trello list ID.
|
||||
name : str
|
||||
The new name.
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
JSON with updated list details on success.
|
||||
"""
|
||||
client = _get_client()
|
||||
result = client.rename_list(list_id=list_id, name=name)
|
||||
return _respond(result)
|
||||
|
||||
|
||||
def trello_archive_list(list_id: str) -> str:
|
||||
"""Archive a list.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
list_id : str
|
||||
Trello list ID.
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
JSON with success message.
|
||||
"""
|
||||
client = _get_client()
|
||||
result = client.archive_list(list_id=list_id)
|
||||
return _respond(result)
|
||||
|
||||
|
||||
def trello_move_list(list_id: str, pos: str = "bottom") -> str:
|
||||
"""Move a list to a different position on the board.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
list_id : str
|
||||
Trello list ID.
|
||||
pos : str, optional
|
||||
Position: ``"top"``, ``"bottom"``, or a number (default: ``"bottom"``).
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
JSON with success message.
|
||||
"""
|
||||
client = _get_client()
|
||||
result = client.move_list(list_id=list_id, pos=pos)
|
||||
return _respond(result)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Plugin metadata (used by Hermes plugin loader)
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -191,6 +276,10 @@ PLUGIN_TOOLS = [
|
||||
trello_archive_board,
|
||||
trello_open_board,
|
||||
trello_board_details,
|
||||
trello_create_list,
|
||||
trello_rename_list,
|
||||
trello_archive_list,
|
||||
trello_move_list,
|
||||
]
|
||||
PLUGIN_REQUIRES_ENV = ["TRELLO_API_KEY", "TRELLO_TOKEN"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user