> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trello

> Agno TrelloTools 帮助将 Trello 功能集成到您的代理中，从而实现对看板、列表和卡片的管理。

## 先决条件

以下示例需要 `trello` 库和 Trello API 凭据，这些凭据可以通过遵循 Trello 的开发者文档获得。

```shell theme={null}
pip install -U trello
```

设置以下环境变量：

```shell theme={null}
export TRELLO_API_KEY="YOUR_API_KEY"
export TRELLO_API_SECRET="YOUR_API_SECRET"
export TRELLO_TOKEN="YOUR_TOKEN"
```

## 示例

下面的代理将创建一个名为 `ai-agent` 的看板，并在其中创建名为 `todo` 和 `doing` 的列表，然后在每个列表中创建名为 `create agent` 的卡片。

```python theme={null}
from agno.agent import Agent
from agno.tools.trello import TrelloTools

agent = Agent(
    instructions=[
        "You are a Trello management assistant that helps organize and manage Trello boards, lists, and cards",
        "Help users with tasks like:",
        "- Creating and organizing boards, lists, and cards",
        "- Moving cards between lists",
        "- Retrieving board and list information",
        "- Managing card details and descriptions",
        "Always confirm successful operations and provide relevant board/list/card IDs and URLs",
        "When errors occur, provide clear explanations and suggest solutions",
    ],
    tools=[TrelloTools()],
    show_tool_calls=True,
)

agent.print_response(
    "Create a board called ai-agent and inside it create list called 'todo' and 'doing' and inside each of them create card called 'create agent'",
    stream=True,
)

```

## Toolkit 功能

| Function          | Description              |
| ----------------- | ------------------------ |
| `create_card`     | 在指定的看板和列表中创建新卡片。         |
| `get_board_lists` | 获取指定 Trello 看板上的所有列表。    |
| `move_card`       | 将卡片移动到不同的列表。             |
| `get_cards`       | 从指定的列表中检索所有卡片。           |
| `create_board`    | 创建一个新的 Trello 看板。        |
| `create_list`     | 在指定的看板上创建新列表。            |
| `list_boards`     | 列出已认证用户可访问的所有 Trello 看板。 |

## Toolkit 参数

这些参数会传递给 `TrelloTools` 构造函数。

| Parameter         | Type            | Default | Description                                 |
| ----------------- | --------------- | ------- | ------------------------------------------- |
| `api_key`         | `Optional[str]` | `None`  | Trello API 密钥。默认为 `TRELLO_API_KEY` 环境变量。    |
| `api_secret`      | `Optional[str]` | `None`  | Trello API 密钥。默认为 `TRELLO_API_SECRET` 环境变量。 |
| `token`           | `Optional[str]` | `None`  | Trello token。默认为 `TRELLO_TOKEN` 环境变量。       |
| `create_card`     | `bool`          | `True`  | 启用 `create_card` 工具。                        |
| `get_board_lists` | `bool`          | `True`  | 启用 `get_board_lists` 工具。                    |
| `move_card`       | `bool`          | `True`  | 启用 `move_card` 工具。                          |
| `get_cards`       | `bool`          | `True`  | 启用 `get_cards` 工具。                          |
| `create_board`    | `bool`          | `True`  | 启用 `create_board` 工具。                       |
| `create_list`     | `bool`          | `True`  | 启用 `create_list` 工具。                        |
| `list_boards`     | `bool`          | `True`  | 启用 `list_boards` 工具。                        |

### `list_boards` 的看板筛选选项

`list_boards` 函数接受一个 `board_filter` 参数，该参数有以下选项：

* `all` (默认)
* `open`
* `closed`
* `organization`
* `public`
* `starred`

## 开发者资源

* 查看 [Tools Source](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/trello.py)
* 查看 [Cookbook Example](https://github.com/agno-agi/agno/blob/main/cookbook/tools/trello_tools.py)
