> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Organization Tools

> MCP tools for querying organization structure, metrics, and group hierarchy

# Organization Tools

Explore your organization — data summaries, corporate group hierarchy, and entity connections. These tools are the starting point for understanding what data is available before diving into specific categories.

## `get_organization_metrics`

Get a summary of what data exists — counts of facilities, vehicles, employees, purchases, and more.

**Parameters:**

| Parameter         | Type   | Required | Default     | Description       |
| ----------------- | ------ | -------- | ----------- | ----------------- |
| `organization_id` | string | No       | default org | Organization UUID |

<Note>
  Purchase and business travel counts reflect **only active records**. `list_purchases` and `list_business_travels` totals will be higher because they include all statuses (active, error, deleted) by default. To match these counts, filter those tools with `status=active`.
</Note>

**Example response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "limits": { "facilities": 50, "vehicles": 100, "employees": 100 },
  "facilities": 25,
  "vehicles": 69,
  "employees": 99,
  "purchases": 59197,
  "business_travels": 2349,
  "logistic_requests": 154522,
  "sold_products": 8,
  "social_governance": 3,
  "events": 2,
  "ms_risks": 5,
  "ms_opportunities": 2,
  "ms_nc_types": 7
}
```

**Key response fields:**

| Field               | Description                                         |
| ------------------- | --------------------------------------------------- |
| `limits`            | Plan limits for facilities, vehicles, and employees |
| `facilities`        | Number of active facilities                         |
| `purchases`         | Active purchase records (Scope 3)                   |
| `business_travels`  | Active business travel records (Scope 3)            |
| `logistic_requests` | Logistics transport records (Scope 3)               |
| `sold_products`     | Sold product records (Scope 3)                      |

## `get_organization_tree`

Get the parent-child hierarchy tree. Useful for corporate groups with subsidiaries.

**Parameters:**

| Parameter            | Type    | Required | Default     | Description                         |
| -------------------- | ------- | -------- | ----------- | ----------------------------------- |
| `organization_id`    | string  | No       | default org | UUID of the root organization       |
| `include_facilities` | boolean | No       | false       | Include facilities in each org node |

**Example response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "cefc7985-...",
  "name": "Parent Corp",
  "children": [
    {
      "id": "a1b2c3d4-...",
      "name": "Spain Office",
      "children": []
    },
    {
      "id": "e5f6a7b8-...",
      "name": "Italy Branch",
      "children": [
        { "id": "c9d0e1f2-...", "name": "Milan Factory", "children": [] }
      ]
    }
  ]
}
```

## `get_organization_canvas`

Get a canvas view of all organizations in the group with their sectors, countries, and connections.

**Parameters:**

| Parameter         | Type   | Required | Default     | Description       |
| ----------------- | ------ | -------- | ----------- | ----------------- |
| `organization_id` | string | No       | default org | Organization UUID |

**Example response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  {
    "org_id": "cefc7985-...",
    "org_name": "Parent Corp",
    "country": "ES",
    "sector": "transport",
    "inputs": null,
    "outputs": ["a1b2c3d4-...", "e5f6a7b8-..."]
  },
  {
    "org_id": "a1b2c3d4-...",
    "org_name": "Spain Office",
    "country": "ES",
    "sector": "logistics",
    "inputs": ["cefc7985-..."],
    "outputs": null
  }
]
```

**Key response fields:**

| Field     | Description                                       |
| --------- | ------------------------------------------------- |
| `sector`  | Industry sector of the organization               |
| `country` | ISO country code                                  |
| `inputs`  | Parent organization UUIDs (upstream connections)  |
| `outputs` | Child organization UUIDs (downstream connections) |

## Remote-Mode Tools

These tools are only available when connecting to the remote MCP server (`https://mcp.dcycle.io`), not in local mode.

### `list_my_organizations`

List all organizations the authenticated user has access to. Use this to discover available organizations, then call `set_default_organization` to pick one.

### `set_default_organization`

Set the default organization for the session. After calling this, all tools use this organization automatically without needing `organization_id` each time.

| Parameter         | Type   | Required | Description                     |
| ----------------- | ------ | -------- | ------------------------------- |
| `organization_id` | string | **Yes**  | UUID of the organization to use |

**Example prompts:**

```
"How many facilities and vehicles do we have?"
"Give me an overview of our organization's data"
"Show me the organization structure"
"Which subsidiaries does my company have?"
"Show the org tree with facilities included"
"What companies are in our group and where are they?"
```

## Workflow

1. **Get overview** — `get_organization_metrics` to see what data exists and plan limits
2. **Explore hierarchy** — `get_organization_tree` for parent-child structure (add `include_facilities=true` for site details)
3. **View connections** — `get_organization_canvas` for the full group map with sectors and countries
4. **Dive into data** — Use specific tools: `list_facilities`, `list_vehicles`, `list_purchases`, etc.

## Related

<CardGroup cols={2}>
  <Card title="Facilities" icon="building" href="/mcp/facilities">
    Sites and locations within the organization
  </Card>

  <Card title="Members" icon="users" href="/mcp/members">
    Users and roles in the organization
  </Card>

  <Card title="Emissions" icon="smog" href="/mcp/emissions">
    GHG emissions data for the organization
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/organizations/overview">
    REST API endpoints for organizations
  </Card>

  <Card title="CLI" icon="terminal" href="/cli/organizations">
    Manage organizations from the command line
  </Card>
</CardGroup>
