get_analytics_service_provider
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.
{
"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.
{
"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
| Field | Type | Description |
|---|---|---|
intake | object | |
intake.byState | array of object | Every state the organization's vouchers are in, largest first. |
intake.byState[].count | integer | |
intake.byState[].state | string | |
intake.byState[].value | integer | Summed face value, in CENTS. |
intake.paid | integer | Vouchers it has been paid for. |
intake.received | integer | Vouchers verified to this organization, in any state from VERIFIED to PAID. |
intake.redeemed | integer | Vouchers whose procedure it has performed (PERFORMED_PENDING_CLAIM to PAID). |
orgId | string (uuid) | |
orgName | string | |
payouts | object | |
payouts.awaitingTransfer | integer | CENTS settled on the ledger whose transfer is PENDING or FAILED. |
payouts.awaitingTransferCount | integer | |
payouts.currency | string | |
payouts.received | integer | CENTS whose transfer reached the organization (SENT or NOT_REQUIRED). |
payouts.receivedCount | integer | |
payouts.recent | array of object | The ten most recent payouts, newest first. |
payouts.recent[].amount | integer | CENTS. |
payouts.recent[].clawbackCount | integer | How 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[].currency | string | |
payouts.recent[].settledAt | integer | Epoch MILLISECONDS. |
payouts.recent[].transactionId | string (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.
400Platform staff holding the feature in no organization — the analytics describe one.
403The caller holds
hospital.reports.viewin 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.
{
"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
}
}