{
  "service": "microsoft_clarity",
  "displayName": "Microsoft Clarity",
  "categories": [
    "Data"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "API Access Token",
      "placeholder": "clarity_api_token",
      "description": "Microsoft Clarity API access token sent with the Authorization Bearer header. Project admins can generate it in Settings > Data Export in the Clarity dashboard, as documented at https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-data-export-api."
    }
  ],
  "homepageUrl": "https://clarity.microsoft.com",
  "actions": [
    {
      "id": "microsoft_clarity.export_live_insights",
      "service": "microsoft_clarity",
      "name": "export_live_insights",
      "description": "Export Microsoft Clarity live insights for the last 1 to 3 days with up to three optional breakdown dimensions.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "numOfDays": {
            "anyOf": [
              {
                "const": 1,
                "type": "number",
                "description": "Export the last 24 hours."
              },
              {
                "const": 2,
                "type": "number",
                "description": "Export the last 48 hours."
              },
              {
                "const": 3,
                "type": "number",
                "description": "Export the last 72 hours."
              }
            ],
            "description": "The number of days to export. Use 1, 2, or 3 for the last 24, 48, or 72 hours."
          },
          "dimension1": {
            "type": "string",
            "enum": [
              "Browser",
              "Device",
              "Country/Region",
              "OS",
              "Source",
              "Medium",
              "Campaign",
              "Channel",
              "URL"
            ],
            "description": "The first optional dimension used to break down the exported insights."
          },
          "dimension2": {
            "type": "string",
            "enum": [
              "Browser",
              "Device",
              "Country/Region",
              "OS",
              "Source",
              "Medium",
              "Campaign",
              "Channel",
              "URL"
            ],
            "description": "The second optional dimension used to break down the exported insights."
          },
          "dimension3": {
            "type": "string",
            "enum": [
              "Browser",
              "Device",
              "Country/Region",
              "OS",
              "Source",
              "Medium",
              "Campaign",
              "Channel",
              "URL"
            ],
            "description": "The third optional dimension used to break down the exported insights."
          }
        },
        "additionalProperties": false,
        "required": [
          "numOfDays"
        ],
        "description": "Input parameters for exporting Microsoft Clarity live insights."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "insights": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "metricName": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The metric group name returned by Microsoft Clarity."
                },
                "information": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": true,
                    "description": "One Microsoft Clarity insight row that contains metric values and dimension fields."
                  },
                  "description": "The rows returned for this metric group."
                }
              },
              "additionalProperties": true,
              "description": "One metric group returned by the Microsoft Clarity Data Export API."
            },
            "description": "The metric groups returned by the Microsoft Clarity Data Export API."
          }
        },
        "additionalProperties": false,
        "required": [
          "insights"
        ],
        "description": "The exported Microsoft Clarity live insights."
      }
    }
  ]
}
