Docs/ AI 助手/ 工具参考

工具参考

通过 MCP 服务器暴露的全部 103 个 AI 工具的完整参考。每个工具包含风险级别、参数和示例用法。

Risk Levels

每个工具按风险级别分类。风险决定了执行所需的 API 密钥作用域。

风险所需作用域描述
readread / standard / admin安全查询。无状态更改。
writestandard / admin修改状态(重启、部署、沙箱命令)。
destructive仅 admin不可逆操作。需要确认令牌。

读取工具 (37)

list_apps

列出所有已部署应用及其状态、技术栈和资源使用情况。

参数类型必填描述
pageintegerNo页码(默认:1)
per_pageintegerNo每页结果数(默认:20,最大:100)

get_app

获取特定应用的详细信息,包括域名、环境变量数量、部署状态和资源配置。

参数类型必填描述
app_idstringYes应用 ID 或应用名称

get_server_status

获取服务器健康状况,包括版本、运行时间、应用数量和 Docker 连接状态。无参数。

list_deployments

列出应用的部署历史。

参数类型必填描述
app_idstringYes应用 ID 或应用名称

get_deployment_logs

获取特定部署的构建日志。

参数类型必填描述
deployment_idstringYes部署 ID

get_app_logs

获取运行中应用的最近容器日志。

参数类型必填描述
app_idstringYes应用 ID 或应用名称
linesintegerNo行数(默认:200,最大:1000)

list_databases

列出所有已配置的数据库。无参数。

list_cron_jobs

列出所有定时任务。无参数。

list_backups

列出所有备份记录。无参数。

list_domains

列出为应用配置的域名。

参数类型必填描述
app_idstringYes应用 ID 或应用名称

list_alerts

列出所有告警规则。无参数。

server_metrics

获取服务器资源指标:CPU、内存、磁盘使用和网络 I/O。无参数。

list_database_servers

List all database servers with their status, engine, and version.

get_database_server

Get detailed information about a specific database server. Param: server_id (string, required).

get_db_connection_info

Get connection details (host, port, credentials) for a database server. Param: server_id (string, required).

list_auth_servers

List all authentication servers (Logto instances).

list_realtime_servers

List all realtime servers (Centrifugo instances).

list_function_servers

List all function servers (Deno Deploy instances).

list_mail_domains

List all mail domains and their status.

list_storage_instances

List all file storage instances (MinIO).

list_uptime_checks

List all uptime monitoring checks.

list_nodes

List all registered server nodes in the cluster.

list_projects

List all projects and their resource counts.

Plus 18 more read tools for getting details on individual auth servers, realtime servers, function servers, mail domains, mailboxes, aliases, storage instances, buckets, access keys, usage, uptime checks, incidents, nodes, and project members. All follow the same pattern with a required ID parameter.

写入工具 (44)

这些工具修改服务器状态。需要 standardadmin 作用域的 API 密钥。

restart_app

重启应用的容器(主容器 + 副本)。

参数类型必填描述
app_idstringYes应用 ID 或应用名称

deploy_app

为应用触发新的部署。

参数类型必填描述
app_idstringYes应用 ID 或应用名称

scale_app

更改应用的副本数量。

参数类型必填描述
app_idstringYes应用 ID 或应用名称
replicasintegerYes副本数量(1-50)

trigger_backup

立即触发备份任务。

参数类型必填描述
backup_idstringYes备份配置 ID

trigger_cron

立即执行定时任务(在计划之外)。

参数类型必填描述
cron_idstringYes定时任务 ID

sandbox_exec_command

在应用的 AI 沙箱容器中执行命令。沙箱是一个完整的 Alpine Linux 环境,具有 root 权限、共享网络和可写卷。5 分钟超时,100KB 输出限制。

参数类型必填描述
app_idstringYes应用 ID 或应用名称
commandstringYes要执行的 Shell 命令
Example
{"name": "sandbox_exec_command", "arguments": {"app_id": "my-app", "command": "curl -s localhost:3000/health"}}
Note
需要应用启用 sandbox_enabled: true。在应用 Settings 中或通过 PATCH /api/v1/apps/:id 启用。

create_database_server

Create a new database server (PostgreSQL, MySQL, MariaDB, or Redis). Params: name, engine, version (optional).

start_* / stop_*

Start or stop database servers, auth servers, realtime servers, and function servers. Each takes a server_id parameter.

create_* (service resources)

Create auth servers, realtime servers, function servers, mail domains, mailboxes, aliases, storage instances, buckets, access keys, uptime checks, nodes, and projects. Each follows the same pattern with resource-specific required parameters.

28 new write tools for creating and managing all service types. All require standard or admin API key scope.

销毁工具 (11)

需要 admin 作用域 API 密钥和两步确认流程的不可逆操作。

Warning
销毁工具不会立即执行。它们返回一个一次性确认令牌(5 分钟有效)。AI 必须使用该令牌调用 confirm_action 才能继续。这可以防止意外删除。

delete_app

删除应用及其容器,可选删除卷。返回确认令牌。

参数类型必填描述
app_idstringYes应用 ID 或应用名称

delete_database

删除已配置的数据库。返回确认令牌。

参数类型必填描述
database_idstringYes数据库 ID

confirm_action

使用 delete_appdelete_database 返回的令牌确认并执行待定的销毁操作。

参数类型必填描述
tokenstringYes确认令牌(一次性,5 分钟 TTL)

delete_* (services)

Delete database servers, auth servers, realtime servers, function servers, mail domains, storage instances, uptime checks, nodes, and projects. All require confirmation and admin API key scope. 9 new destructive tools in total.

沙箱工具 (5)

这些工具与 AI 沙箱容器交互。所有工具都需要目标应用启用 sandbox_enabled: truesandbox_exec_command 在上方写入工具中已记录。其余 4 个是读取风险工具。

sandbox_read_file

通过沙箱读取应用挂载卷中的文件。最多返回 100KB。

参数类型必填描述
app_idstringYes应用 ID 或应用名称
pathstringYes绝对文件路径(例如 /app/config.yml
Example
{"name": "sandbox_read_file", "arguments": {"app_id": "my-app", "path": "/app/package.json"}}

sandbox_list_processes

列出应用容器内的运行进程(在应用容器中运行 ps aux,非沙箱)。

参数类型必填描述
app_idstringYes应用 ID 或应用名称

sandbox_check_connectivity

从沙箱测试网络连通性。使用 nc 进行 TCP 端口检查或 curl 进行 HTTP 检查。

参数类型必填描述
app_idstringYes应用 ID 或应用名称
targetstringYes主机名或 IP(例如 dbredislocalhost
portintegerNo端口号。省略时使用 HTTP (curl)。
Example (TCP)
{"name": "sandbox_check_connectivity", "arguments": {"app_id": "my-app", "target": "db", "port": 5432}}

sandbox_status

检查应用的沙箱状态。返回沙箱是否已启用、正在运行及其容器 ID。

参数类型必填描述
app_idstringYes应用 ID 或应用名称