{
  "schemaVersion": "agent9-managed-tool-package-v1",
  "name": "managed_auto_oncall_manus",
  "version": 7,
  "description": "Manus-backed read-only evidence Tool for ticket-bound OP metrics, logs, and SQL queries. The Manus connector and credentials remain inside its isolated Tool Sandbox.",
  "parameters": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "accountAlias",
      "issueKey",
      "target",
      "operation",
      "start",
      "end"
    ],
    "properties": {
      "accountAlias": {
        "const": "Manus"
      },
      "issueKey": {
        "type": "string",
        "pattern": "^APID-[0-9]+$"
      },
      "target": {
        "enum": [
          "vida",
          "monica"
        ]
      },
      "operation": {
        "enum": [
          "metrics",
          "topsql",
          "slow_query",
          "statements",
          "logs"
        ]
      },
      "query": {
        "type": "string",
        "minLength": 1,
        "maxLength": 8192,
        "description": "PromQL authored by the Agent. Use the literal {{instance}} placeholder when instanceRef is supplied."
      },
      "queryName": {
        "type": "string",
        "maxLength": 80
      },
      "unit": {
        "type": "string",
        "maxLength": 32
      },
      "instanceRef": {
        "type": "string",
        "maxLength": 2048
      },
      "start": {
        "type": "integer"
      },
      "end": {
        "type": "integer"
      },
      "step": {
        "type": "integer",
        "minimum": 15,
        "maximum": 300
      },
      "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 20
      },
      "component": {
        "enum": [
          "tidb",
          "tikv",
          "tiflash",
          "pd"
        ]
      },
      "level": {
        "enum": [
          "debug",
          "info",
          "warn",
          "critical",
          "error"
        ]
      },
      "keywords": {
        "type": "array",
        "maxItems": 3,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        }
      },
      "filter": {
        "type": "string",
        "maxLength": 128
      }
    }
  },
  "entrypoint": "index.mjs",
  "secretEnv": [
    "MANUS_GRAFANA_USERNAME",
    "MANUS_GRAFANA_PASSWORD",
    "MANUS_DASHBOARD_USERNAME",
    "MANUS_DASHBOARD_PASSWORD",
    "MANUS_MONICA_DASHBOARD_USERNAME",
    "MANUS_MONICA_DASHBOARD_PASSWORD",
    "MANUS_REFERENCE_KEY"
  ],
  "timeoutMs": 120000,
  "maxOutputBytes": 131072,
  "network": {
    "mode": "restricted",
    "allowedHosts": [
      "tidb-grafana-manus.prod.ops.butterfly-effect.dev",
      "tidb-dashboard-manus.prod.ops.butterfly-effect.dev",
      "tidb-prometheus-monica.prod.ops.butterfly-effect.dev",
      "tidb-dashboard-monica.prod.ops.butterfly-effect.dev"
    ]
  },
  "egress": []
}
