查询监控对象工具能力清单
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
}
'import requests
url = "https://api.flashcat.cloud/monit/tools/catalog?app_key="
payload = {
"account_id": 10001,
"target_locator": "web-01",
"include_output_shape": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({account_id: 10001, target_locator: 'web-01', include_output_shape: true})
};
fetch('https://api.flashcat.cloud/monit/tools/catalog?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/monit/tools/catalog?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => 10001,
'target_locator' => 'web-01',
'include_output_shape' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/monit/tools/catalog?app_key="
payload := strings.NewReader("{\n \"account_id\": 10001,\n \"target_locator\": \"web-01\",\n \"include_output_shape\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/monit/tools/catalog?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": 10001,\n \"target_locator\": \"web-01\",\n \"include_output_shape\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/monit/tools/catalog?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": 10001,\n \"target_locator\": \"web-01\",\n \"include_output_shape\": true\n}"
response = http.request(request)
puts response.read_body{
"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
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}诊断分析
查询监控对象工具能力清单
根据 target_locator(host、mysql 等)查询该监控对象上 monit-agent 当前暴露的工具能力。返回每个工具的名称、描述以及 JSON-Schema input_schema。配合 /monit/tools/invoke 驱动 AI-SRE 的工具调用。
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
}
'import requests
url = "https://api.flashcat.cloud/monit/tools/catalog?app_key="
payload = {
"account_id": 10001,
"target_locator": "web-01",
"include_output_shape": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({account_id: 10001, target_locator: 'web-01', include_output_shape: true})
};
fetch('https://api.flashcat.cloud/monit/tools/catalog?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/monit/tools/catalog?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => 10001,
'target_locator' => 'web-01',
'include_output_shape' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/monit/tools/catalog?app_key="
payload := strings.NewReader("{\n \"account_id\": 10001,\n \"target_locator\": \"web-01\",\n \"include_output_shape\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/monit/tools/catalog?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": 10001,\n \"target_locator\": \"web-01\",\n \"include_output_shape\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/monit/tools/catalog?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": 10001,\n \"target_locator\": \"web-01\",\n \"include_output_shape\": true\n}"
response = http.request(request)
puts response.read_body{
"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
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}调用限制
| 项 | 值 |
|---|---|
| 速率限制 | 600 次/分钟;10 次/秒 每账户 |
| 权限 | 任意有效的 app_key(只读;不受特定权限分类约束) |
使用说明
- 使用
target_locator标识监控对象;target_kind可选,省略时自动推断。内置的 target kind 包括host与mysql。 - 若同一 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_unavailable、unknown_toolset_hash、ambiguous_target_kind)以 HTTP 200 返回,data.error非空。只有协议 / 鉴权 / 内部错误才使用标准错误信封。
授权
在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API 时都必须携带。它等同于所属账户的身份凭证,请妥善保管。
请求体
application/json
监控对象标识(主机名、MySQL 地址等)。最长 256 字节;不允许空白、控制字符或 |。
可选的一致性校验。若提供,必须等于已认证账户。
可选的 target kind。省略时 webapi 在当前已知的 kind 中自动推断。内置 kind:host、mysql。上次返回 ambiguous_target_kind 时,重试必须传入此字段。
为 true 时,每个工具条目额外返回其 output_shape JSON Schema。默认 false,以便为 LLM 消费保持响应精简。
此页面对您有帮助吗?