get_orgs_tree

Read-only

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.

json
{
  "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.

json
[
  {
    "descendants": [
      {}
    ],
    "id": "11111111-1111-4111-8111-111111111111",
    "isPlatform": true,
    "name": "string",
    "createdAt": 1,
    "parentId": "11111111-1111-4111-8111-111111111111",
    "status": "string",
    "type": "string"
  }
]

Fields

FieldTypeDescription
[].createdAtintegerEpoch milliseconds, straight off the DAL entity.
[].descendantsarray of objectChild organizations — the same node shape, nested arbitrarily deep. Always present, empty for a leaf: Org.buildForest seeds every node with descendants: [].
[].descendants[].createdAtintegerEpoch milliseconds, straight off the DAL entity.
[].descendants[].descendantsarray of objectChild organizations — the same node shape, nested arbitrarily deep. Always present, empty for a leaf: Org.buildForest seeds every node with descendants: [].
[].descendants[].descendants[].createdAtintegerEpoch milliseconds, straight off the DAL entity.
[].descendants[].descendants[].descendantsarray of objectChild organizations — the same node shape, nested arbitrarily deep. Always present, empty for a leaf: Org.buildForest seeds every node with descendants: [].
[].descendants[].descendants[].idstring (uuid)
[].descendants[].descendants[].isPlatformbooleanTrue 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[].namestring
[].descendants[].descendants[].parentIdstring (uuid) | null
[].descendants[].descendants[].statusstring
[].descendants[].descendants[].typestring
[].descendants[].idstring (uuid)
[].descendants[].isPlatformbooleanTrue 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[].namestring
[].descendants[].parentIdstring (uuid) | null
[].descendants[].statusstring
[].descendants[].typestring
[].idstring (uuid)
[].isPlatformbooleanTrue 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.
[].namestring
[].parentIdstring (uuid) | null
[].statusstring
[].typestring

When it fails

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

403

The bearer verified but belongs to the donor realm; authenticate refuses 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.

json
{
  "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
  }
}