跳转到主要内容
POST
/
monit
/
tools
/
catalog
查询监控对象工具能力清单
curl --request POST \
  --url 'https://api.flashcat.cloud/monit/tools/catalog?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "account_id": 10001,
  "target_locator": "web-01",
  "include_output_shape": true
}
'
{
  "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
  "data": {
    "target": {
      "kind": "host",
      "locator": "web-01"
    },
    "tools": [
      {
        "name": "os.overview",
        "target_kind": "host",
        "description": "Returns a bounded overview of host health (CPU, memory, disk, network, top processes).",
        "input_schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        },
        "output_shape": {
          "type": "object",
          "required": [
            "data",
            "summary",
            "truncated"
          ],
          "properties": {
            "data": {
              "type": "object"
            },
            "summary": {
              "type": "string"
            },
            "truncated": {
              "type": "object"
            }
          }
        }
      }
    ],
    "error": null
  }
}

调用限制

速率限制600 次/分钟;10 次/秒 每账户
权限任意有效的 app_key(只读;不受特定权限分类约束)

使用说明

  • 使用 target_locator 标识监控对象;target_kind 可选,省略时自动推断。内置的 target kind 包括 hostmysql
  • 若同一 locator 匹配多个 kind,响应为 HTTP 200,data.error.code = "ambiguous_target_kind",并附带 target_kinds 列表——请带上显式的 target_kind 重试。
  • 工具能力清单是候选能力视图,并非执行保证。目标 Agent 可能在拿到清单与发起调用之间下线,本地 Agent 策略也可能在调用时拦截某些工具。
  • 设置 include_output_shape: true 可额外返回每个工具的 output_shape。默认为 false,以便为 LLM 消费保持响应精简。
  • 业务错误(target_unavailableunknown_toolset_hashambiguous_target_kind)以 HTTP 200 返回,data.error 非空。只有协议 / 鉴权 / 内部错误才使用标准错误信封。

授权

app_key
string
query
必填

在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API 时都必须携带。它等同于所属账户的身份凭证,请妥善保管。

请求体

application/json
target_locator
string
必填

监控对象标识(主机名、MySQL 地址等)。最长 256 字节;不允许空白、控制字符或 |

account_id
integer<int64>

可选的一致性校验。若提供,必须等于已认证账户。

target_kind
string

可选的 target kind。省略时 webapi 在当前已知的 kind 中自动推断。内置 kind:hostmysql。上次返回 ambiguous_target_kind 时,重试必须传入此字段。

include_output_shape
boolean
默认值:false

为 true 时,每个工具条目额外返回其 output_shape JSON Schema。默认 false,以便为 LLM 消费保持响应精简。

响应

成功

成功响应结构。2xx 响应中 request_id 标识本次调用(同时出现在 Flashcat-Request-Id 响应头中),data 为接口业务 payload。失败响应使用不同结构,参见 ErrorResponse

request_id
string
必填

本次请求的唯一 ID,也会在 Flashcat-Request-Id 响应头中返回。反馈问题时请一并附上。

示例:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

data
object
必填

每个接口自己的业务 payload,详见各接口的 200 响应 schema。