> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-mcp/tool-reference/evaluations-and-monitoring/evals-datasets-create.md).

# evals\_datasets\_create

Create a collection of test cases for evaluating a project.

**Effect:** This call saves data or changes configuration. Review the behavior below before using it.

## Inputs

| Name            | Type          | Requirement | Description                                                                                                                                                     |
| --------------- | ------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_id`    | string        | Required    | ID returned by `projects_list`; use a project in the active organization.                                                                                       |
| `name`          | string        | Required    | Resource name.                                                                                                                                                  |
| `node_contract` | object        | Required    | Required input/output mapping: `input_kind`, nonempty `input_keys`, and nonempty `output_node_ids`. See the shape below.                                        |
| `description`   | string        | Optional    | Description of the resource or requested change.                                                                                                                |
| `rows`          | array of rows | Optional    | At most 100 rows per call. Each has an `inputs` object and optional `expected_output` object and `source_run_id` UUID. Omit to create the dataset without rows. |

`node_contract` has `input_kind` (`start_node` or `legacy_input_nodes`), `input_keys` (nonempty string array), and `output_node_ids` (nonempty string array). Copy keys from the project. A Start node uses its field keys; legacy inputs use node IDs.

Each row contains `inputs` (object), optional `expected_output` (object), and optional `source_run_id` (UUID string). Row input keys must match the dataset contract.

## Example

These are MCP tool arguments, not an HTTP request body. Replace bracketed IDs with values returned from your account.

This example assumes a Start input named `question` and an output named `out-0`. Replace them with the project’s actual keys. The regular-expression rule, where used, checks only that the output contains non-whitespace text.

```json
{
  "project_id": "<project-id>",
  "name": "Response review",
  "node_contract": {
    "input_kind": "start_node",
    "input_keys": [
      "question"
    ],
    "output_node_ids": [
      "out-0"
    ]
  }
}
```

## Result

Abbreviated result example; unshown fields are omitted for clarity.

```json
{
  "dataset": {
    "dataset_id": "<dataset-id>",
    "node_contract": {
      "input_kind": "start_node",
      "input_keys": [
        "question"
      ],
      "output_node_ids": [
        "out-0"
      ]
    }
  },
  "warnings": []
}
```

## Behavior

Optional rows are validated before creation.

If row insertion fails, the error contains dataset\_id and dataset\_created=true: inspect all existing rows before repairing.

Do not repeat dataset creation or blindly retry rows.

## Troubleshooting

If the error says `dataset_created=true`, keep `dataset_id`. Read all row pages before adding missing rows; do not create the dataset again.

## Related resources

[Evaluations and monitoring](https://docs.stackai.com/stackai-mcp/tool-reference/evaluations-and-monitoring.md)

[Evaluate a project before rollout](https://docs.stackai.com/stackai-mcp/workflow-recipes/evaluate-a-project-before-rollout.md)

[Connection, permissions, pagination, and recovery](https://docs.stackai.com/stackai-mcp/best-practices-and-troubleshooting.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-mcp/tool-reference/evaluations-and-monitoring/evals-datasets-create.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
