> ## 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.

# Goals & Actions Tools

> MCP tools for targets and the work planned against them — shared by ISO management systems and CSRD

Read and write the planning layer of a project: **goals** (targets with numbers) and **actions** (the work), each linked to the sources they answer. The same tools serve ISO management-system projects and CSRD ones; only what they point at differs.

<Note>
  These tools plan against an assessment. To build the assessment itself — score the matters, write the IROs — use the [CSRD tools](/mcp/csrd).
</Note>

## Source types

A goal or an action can point at several sources at once. Every tool that takes a `source_type` accepts the same seven:

| Value            | What it is                                                          |
| ---------------- | ------------------------------------------------------------------- |
| `iro`            | An impact, risk or opportunity from a double materiality assessment |
| `csrd_datapoint` | An ESRS data point                                                  |
| `custom_kpi`     | A custom KPI                                                        |
| `objective`      | Another goal                                                        |
| `risk`           | An ISO risk                                                         |
| `opportunity`    | An ISO opportunity                                                  |
| `nonconformity`  | An ISO non-conformity                                               |

`source_links` is a list of `{"source_type": ..., "source_id": ...}`.

***

## `list_ms_goals`

List the goals of a project, with their links and KPI progress.

**Parameters:**

| Parameter         | Type    | Required | Default     | Description                               |
| ----------------- | ------- | -------- | ----------- | ----------------------------------------- |
| `project_id`      | string  | Yes      | —           | Project UUID                              |
| `status`          | string  | No       | —           | Filter by status, e.g. `open`             |
| `page`            | integer | No       | 1           | Page number                               |
| `size`            | integer | No       | 100         | Results per page (100 is the API ceiling) |
| `organization_id` | string  | No       | default org | Organization UUID                         |

**Example response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "id": "a1b2c3d4-...",
      "code": "OBJ-001",
      "title": "Cut scope 1 and 2 emissions 42% by 2030",
      "status": "open",
      "unit": "tCO2e",
      "baseline_value": 4200,
      "current_value": 3696,
      "target_value": 2436,
      "source_links": [
        { "source_type": "iro", "source_id": "b2c3d4e5-...", "source_code": "IRO-003" }
      ],
      "kpi_progress": null
    }
  ],
  "total": 3
}
```

**Key response fields:**

| Field                                               | Description                                                                                                        |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `code`                                              | Human-readable id, `OBJ-nnn`                                                                                       |
| `baseline_value` / `current_value` / `target_value` | Progress is how far current has travelled from baseline to target                                                  |
| `source_links`                                      | Everything the goal answers; `source_code` is absent for global sources like ESRS data points                      |
| `kpi_progress`                                      | Present only when the goal is linked to **exactly one** custom KPI, and then carries that KPI's latest submissions |

**Example prompts:**

```
"What goals does this project have and how are they doing?"
"Which goals are behind on their target?"
"Show the open goals linked to an IRO"
```

***

## `get_ms_goal`

Get one goal.

| Parameter         | Type   | Required | Description       |
| ----------------- | ------ | -------- | ----------------- |
| `project_id`      | string | Yes      | Project UUID      |
| `goal_id`         | string | Yes      | Goal UUID         |
| `organization_id` | string | No       | Organization UUID |

***

## `create_ms_goal`

Create a goal.

| Parameter         | Type   | Required | Description                                |
| ----------------- | ------ | -------- | ------------------------------------------ |
| `project_id`      | string | Yes      | Project UUID                               |
| `title`           | string | Yes      | Goal title                                 |
| `description`     | string | No       | Longer description                         |
| `baseline_value`  | number | No       | Value the goal improves from               |
| `current_value`   | number | No       | Where it stands now                        |
| `target_value`    | number | No       | Value it aims at                           |
| `unit`            | string | No       | Unit of the values                         |
| `start_date`      | string | No       | `YYYY-MM-DD`                               |
| `end_date`        | string | No       | `YYYY-MM-DD`                               |
| `source_links`    | array  | No       | `[{"source_type": ..., "source_id": ...}]` |
| `organization_id` | string | No       | Organization UUID                          |

<Note>
  Without both `baseline_value` and `target_value` there is no distance to measure, so the goal reports no progress.
</Note>

**Example prompts:**

```
"Create a goal to halve the accident rate by 2027, linked to IRO-012"
"Add a target for scope 2 emissions based on our renewable electricity KPI"
```

***

## `update_ms_goal`

Update a goal. Takes the same fields as `create_ms_goal` plus `status`, all optional, and `goal_id`.

<Warning>
  Passing `source_links` **replaces the whole set**. Send every link you want to keep, or omit the field to edit only the other fields.
</Warning>

***

## `delete_ms_goal`

Delete a goal, along with any link pointing at it. Actions that addressed the goal keep existing; they simply stop pointing at it.

| Parameter         | Type   | Required | Description       |
| ----------------- | ------ | -------- | ----------------- |
| `project_id`      | string | Yes      | Project UUID      |
| `goal_id`         | string | Yes      | Goal UUID         |
| `organization_id` | string | No       | Organization UUID |

***

## `list_ms_actions`

List the actions of a project, with every source each one addresses. Same parameters as `list_ms_goals`.

**Example response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "items": [
    {
      "id": "c3d4e5f6-...",
      "code": "ACC-001",
      "title": "Move all sites to renewable electricity",
      "status": "open",
      "action_type": "improvement",
      "deadline": "2026-12-31",
      "cost": 45000,
      "source_links": [
        { "source_type": "iro", "source_id": "b2c3d4e5-...", "source_code": "IRO-003" },
        { "source_type": "objective", "source_id": "a1b2c3d4-...", "source_code": "OBJ-001" }
      ]
    }
  ],
  "total": 5
}
```

***

## `get_ms_action`

Get one action, including its attachments.

***

## `create_ms_action`

Create an action addressing one or more sources.

| Parameter         | Type   | Required | Default       | Description                                              |
| ----------------- | ------ | -------- | ------------- | -------------------------------------------------------- |
| `project_id`      | string | Yes      | —             | Project UUID                                             |
| `title`           | string | Yes      | —             | What will be done                                        |
| `source_type`     | string | Yes      | —             | Primary source kind                                      |
| `source_id`       | string | Yes      | —             | UUID of that source                                      |
| `action_type`     | string | No       | `improvement` | `immediate`, `corrective`, `preventive` or `improvement` |
| `description`     | string | No       | —             | Longer description                                       |
| `deadline`        | string | No       | —             | `YYYY-MM-DD`                                             |
| `cost`            | number | No       | —             | Expected cost                                            |
| `source_links`    | array  | No       | —             | Further sources                                          |
| `organization_id` | string | No       | default org   | Organization UUID                                        |

<Warning>
  `source_type`/`source_id` is the **primary** source and is what the action's code is derived from. Everything else goes in `source_links` — do not repeat the primary there.
</Warning>

***

## `update_ms_action`

Update an action. Same fields as `create_ms_action` plus `status`, all optional, and `action_id`. `source_links` replaces the whole set, as on goals.

***

## `delete_ms_action`

Delete an action.

***

## `list_ms_source_links`

The reverse view: what each source of one kind is being addressed by.

| Parameter         | Type   | Required | Description                   |
| ----------------- | ------ | -------- | ----------------------------- |
| `project_id`      | string | Yes      | Project UUID                  |
| `source_type`     | string | Yes      | One of the seven source kinds |
| `organization_id` | string | No       | Organization UUID             |

**Example response:**

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  {
    "source_type": "iro",
    "source_id": "b2c3d4e5-...",
    "source_code": "IRO-003",
    "objectives": [
      { "code": "OBJ-001", "title": "Cut scope 1 and 2 emissions 42% by 2030", "percent_to_target": 29.0 }
    ],
    "actions": [
      { "code": "ACC-001", "title": "Move all sites to renewable electricity" }
    ]
  }
]
```

This answers "which IROs have nothing planned against them" in one call, instead of reading every goal and action and folding the links by hand. **Sources missing from the response have nothing planned at all**, and a source returned with an empty `actions` has a target but no work behind it.

An unknown `source_type` returns an error rather than an empty list, so a typo is never mistaken for "nothing is linked yet".

**Example prompts:**

```
"Which IROs have no action against them?"
"Show me every ESRS data point we have a goal for"
"What is being done about our non-conformities?"
```

## Workflow

1. **Find the project** — `list_projects`
2. **See the targets** — `list_ms_goals` for what exists and how far along it is
3. **See the work** — `list_ms_actions`
4. **Find the gaps** — `list_ms_source_links` per source kind; anything absent has nothing planned
5. **Close them** — `create_ms_goal` for a target, then `create_ms_action` pointing at both the source and the goal

## Related

<CardGroup cols={2}>
  <Card title="CSRD" icon="leaf" href="/mcp/csrd">
    Double materiality and the IROs these goals answer
  </Card>

  <Card title="Custom KPIs" icon="chart-line" href="/mcp/custom-kpis">
    The KPIs a goal can track its current value from
  </Card>

  <Card title="Projects" icon="clipboard-list" href="/mcp/projects">
    The projects goals and actions live in
  </Card>

  <Card title="Decarbonization" icon="arrow-trend-down" href="/mcp/decarb">
    Emission reduction targets and actions, tracked separately
  </Card>
</CardGroup>
