Metrics

KPI snapshots and ingestion.

4 actions. Each is callable by the agent as a tool, over HTTP via /api/invoke, and (usually) from a UI page.

metrics.summary

GET

The four dashboard KPI tiles (total impressions, engagement rate, followers gained, content published) with prior-period deltas. Internal KPIs are computed live from tickets/engagements; external KPIs come from the latest metric snapshots.

  • AI tool: metrics_summary
  • API: GET /api/invoke/metrics.summary

Input

Field Type Required Description
days integer
missionId string
subjectId string
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "days": {
      "default": 30,
      "type": "integer",
      "minimum": 1,
      "maximum": 365
    },
    "missionId": {
      "type": "string",
      "minLength": 1
    },
    "subjectId": {
      "type": "string",
      "minLength": 1
    }
  }
}

metrics.timeseries

GET

Daily time-series for the engagement chart: impressions + engagement from snapshots, published count computed from content. Falls back to the internal pipeline series when no external snapshots exist.

  • AI tool: metrics_timeseries
  • API: GET /api/invoke/metrics.timeseries

Input

Field Type Required Description
days integer
missionId string
subjectId string
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "days": {
      "default": 7,
      "type": "integer",
      "minimum": 1,
      "maximum": 365
    },
    "missionId": {
      "type": "string",
      "minLength": 1
    },
    "subjectId": {
      "type": "string",
      "minLength": 1
    }
  }
}

metrics.platforms

GET

Per-platform breakdown for the platform-share donut: latest follower/impression snapshot per platform with share-of-total. Falls back to content-draft volume per platform when no snapshots exist.

  • AI tool: metrics_platforms
  • API: GET /api/invoke/metrics.platforms

Input

Field Type Required Description
missionId string
subjectId string
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "missionId": {
      "type": "string",
      "minLength": 1
    },
    "subjectId": {
      "type": "string",
      "minLength": 1
    }
  }
}

metrics.ingest

POST · mutating

Pull external platform KPIs (followers/impressions/reach/engagement) for connected accounts via Composio (API) and Stagehand (browser), snapshot them, and (re)compute internal KPIs (published/engagement). Triggered by the metrics-ingest cron and the scheduled ingestion workflow. Idempotent.

  • AI tool: metrics_ingest
  • API: POST /api/invoke/metrics.ingest

Input

Field Type Required Description
subjectId string
missionId string
platform string
internalOnly boolean
workspaceId string
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "subjectId": {
      "type": "string",
      "minLength": 1
    },
    "missionId": {
      "type": "string",
      "minLength": 1
    },
    "platform": {
      "type": "string"
    },
    "internalOnly": {
      "type": "boolean"
    },
    "workspaceId": {
      "type": "string"
    }
  }
}