get_orgs_tree
Calls GET /api/orgs/tree as the signed-in person · REST reference
Get the organization hierarchy the caller may see
ONE SHAPE AT 200, always: a BARE ARRAY of root orgs, each carrying a recursive descendants array built from parentId. Who the caller is changes WHICH orgs are in it, never the shape of the answer. Platform staff (derived from permissions by isPlatformStaff, never from a role name) get the whole forest. Everyone else gets the forest filtered to the orgs in which they hold org.view — the graph-resolved principal authenticate populates, not bare membership. A caller holding it nowhere gets []. An empty result is NOT a distinguishable "no access" signal — platform staff against an empty graph receive [] too. Timestamps on each node come straight off the DAL and are epoch MILLISECONDS.
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_orgs_tree",
"arguments": {}
}
}Result
On success (HTTP 200) the tool returns one text item holding the API's JSON, pretty-printed.
The root organizations the caller may see, each with its subtree under descendants. Empty when the caller holds org.view in no organization, or when no organization matches.
[
{
"descendants": [
{}
],
"id": "11111111-1111-4111-8111-111111111111",
"isPlatform": true,
"name": "string",
"createdAt": 1,
"parentId": "11111111-1111-4111-8111-111111111111",
"status": "string",
"type": "string"
}
]Fields
| Field | Type | Description |
|---|---|---|
[].createdAt | integer | Epoch milliseconds, straight off the DAL entity. |
[].descendants | array of object | Child organizations — the same node shape, nested arbitrarily deep. Always present, empty for a leaf: Org.buildForest seeds every node with descendants: []. |
[].descendants[].createdAt | integer | Epoch milliseconds, straight off the DAL entity. |
[].descendants[].descendants | array of object | Child organizations — the same node shape, nested arbitrarily deep. Always present, empty for a leaf: Org.buildForest seeds every node with descendants: []. |
[].descendants[].descendants[].createdAt | integer | Epoch milliseconds, straight off the DAL entity. |
[].descendants[].descendants[].descendants | array of object | Child organizations — the same node shape, nested arbitrarily deep. Always present, empty for a leaf: Org.buildForest seeds every node with descendants: []. |
[].descendants[].descendants[].id | string (uuid) | |
[].descendants[].descendants[].isPlatform | boolean | True on the platform organization, Pawsitive Future Foundation, and false on every other node. Nothing else identifies it: its type is NETWORK, like any network. Every organization with no parent sits under it. |
[].descendants[].descendants[].name | string | |
[].descendants[].descendants[].parentId | string (uuid) | null | |
[].descendants[].descendants[].status | string | |
[].descendants[].descendants[].type | string | |
[].descendants[].id | string (uuid) | |
[].descendants[].isPlatform | boolean | True on the platform organization, Pawsitive Future Foundation, and false on every other node. Nothing else identifies it: its type is NETWORK, like any network. Every organization with no parent sits under it. |
[].descendants[].name | string | |
[].descendants[].parentId | string (uuid) | null | |
[].descendants[].status | string | |
[].descendants[].type | string | |
[].id | string (uuid) | |
[].isPlatform | boolean | True on the platform organization, Pawsitive Future Foundation, and false on every other node. Nothing else identifies it: its type is NETWORK, like any network. Every organization with no parent sits under it. |
[].name | string | |
[].parentId | string (uuid) | null | |
[].status | string | |
[].type | string |
When it fails
A failed call returns isError: true with the API's message as text.
403The bearer verified but belongs to the donor realm;
authenticaterefuses it here. This route has no permission gate of its own — access is narrowed by filtering, not by a 403.
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_orgs_tree",
"description": "GET /api/orgs/tree — ONE SHAPE AT 200, always: a BARE ARRAY of root orgs, each carrying a recursive `descendants` array built from `parentId`. Who the caller is changes WHICH orgs are in it, never the shape of the answer. Platform staff (derived from permissions by `isPlatformStaff`, never from a role name) get the whole forest. Everyone else gets the forest filtered to the orgs in which they hold `org.view` — the graph-resolved principal `authenticate` populates, not bare membership. A caller holding it nowhere gets `[]`. An empty result is NOT a distinguishable \"no access\" signal — platform staff against an empty graph receive `[]` too. Timestamps on each node come straight off the DAL and are epoch MILLISECONDS.",
"inputSchema": {
"type": "object",
"properties": {}
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false
}
}