get_analytics_service_provider

Read-only

Calls GET /api/analytics/service-provider as the signed-in person · REST reference

A service provider's voucher intake and payouts received

The analytics a SERVICE PROVIDER sees in place of the platform's donation figures: the vouchers it has taken in, and the payouts it has received. The organization is the first of the caller's organizations in which it holds hospital.reports.view (a clinic's owner holds it; a read-only member does not and is refused 403); the request names none. Two DAL reads scoped to that one organization - its voucher counts per lifecycle state (the vouchers it has taken — no voucher is ever assigned to a clinic), and its settled payouts through the settlement traversal. A payout counts as RECEIVED only once its transfer is SENT or needed no external transfer (NOT_REQUIRED); PENDING and FAILED are reported apart as awaiting transfer, because the ledger settling does not mean the money moved. Money is integer CENTS.

Arguments

This tool takes no arguments.

Example call

A client sends this over the MCP session; Claude and other agents build it for you. The values are placeholders — the shape is real.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_analytics_service_provider",
    "arguments": {}
  }
}

Result

On success (HTTP 200) the tool returns one text item holding the API's JSON, pretty-printed.

The organization's intake and payouts.

json
{
  "intake": {
    "byState": [
      {}
    ],
    "paid": 1,
    "received": 1,
    "redeemed": 1
  },
  "orgId": "11111111-1111-4111-8111-111111111111",
  "orgName": "string",
  "payouts": {
    "awaitingTransfer": 1,
    "awaitingTransferCount": 1,
    "currency": "string",
    "received": 1,
    "receivedCount": 1,
    "recent": [
      {}
    ]
  }
}

Fields

FieldTypeDescription
intakeobject
intake.byStatearray of objectEvery state the organization's vouchers are in, largest first.
intake.byState[].countinteger
intake.byState[].statestring
intake.byState[].valueintegerSummed face value, in CENTS.
intake.paidintegerVouchers it has been paid for.
intake.receivedintegerVouchers verified to this organization, in any state from VERIFIED to PAID.
intake.redeemedintegerVouchers whose procedure it has performed (PERFORMED_PENDING_CLAIM to PAID).
orgIdstring (uuid)
orgNamestring
payoutsobject
payouts.awaitingTransferintegerCENTS settled on the ledger whose transfer is PENDING or FAILED.
payouts.awaitingTransferCountinteger
payouts.currencystring
payouts.receivedintegerCENTS whose transfer reached the organization (SENT or NOT_REQUIRED).
payouts.receivedCountinteger
payouts.recentarray of objectThe ten most recent payouts, newest first.
payouts.recent[].amountintegerCENTS.
payouts.recent[].clawbackCountintegerHow many clawbacks are against the vouchers this payout settled.
payouts.recent[].clawbackStatus"REQUESTED" | "APPROVED" | "EXECUTING" | "RECOVERED" | "PARTIALLY_RECOVERED" | "WRITTEN_OFF" | … (7 values)The status of the latest payout clawback against a voucher, resolved ones included — what the voucher's (or its payout's) clawback chip says. Null when there is none. DENIED is never reported, nor a REQUESTED clawback Pawsitive Future filed: until it is approved it is Pawsitive Future's own deliberation.
payouts.recent[].currencystring
payouts.recent[].settledAtintegerEpoch MILLISECONDS.
payouts.recent[].transactionIdstring (uuid)
payouts.recent[].transferState"PENDING" | "SENT" | "FAILED" | "NOT_REQUIRED"

When it fails

A failed call returns isError: true with the API's message as text.

400

Platform staff holding the feature in no organization — the analytics describe one.

403

The caller holds hospital.reports.view in no organization, or the organization it holds it in is not a service provider.

What the model is shown

This is the tool exactly as the server lists it in tools/list. The description starts with the REST call it makes.

json
{
  "name": "get_analytics_service_provider",
  "description": "GET /api/analytics/service-provider — The analytics a SERVICE PROVIDER sees in place of the platform's donation figures: the vouchers it has taken in, and the payouts it has received. The organization is the first of the caller's organizations in which it holds `hospital.reports.view` (a clinic's owner holds it; a read-only member does not and is refused 403); the request names none. Two DAL reads scoped to that one organization - its voucher counts per lifecycle state (the vouchers it has taken — no voucher is ever assigned to a clinic), and its settled payouts through the settlement traversal. A payout counts as RECEIVED only once its transfer is SENT or needed no external transfer (NOT_REQUIRED); PENDING and FAILED are reported apart as awaiting transfer, because the ledger settling does not mean the money moved. Money is integer CENTS.",
  "inputSchema": {
    "type": "object",
    "properties": {}
  },
  "annotations": {
    "readOnlyHint": true,
    "openWorldHint": false
  }
}