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

# insert_rows

> Insert up to 100 rows into a table and get them back with their ids.

Inserts rows in one transaction. Either every row is inserted or none are.

| | |
| - | - |
| Scope | `mcp:write` |
| Annotations | `readOnlyHint: false` |
| Activity event | `insert_rows` with `table` and `count` |

## Parameters

<ParamField body="projectId" type="string" required>
  Project id from `list_projects`. You need write access.
</ParamField>

<ParamField body="table" type="string" required>
  Table name.
</ParamField>

<ParamField body="rows" type="object[]" required>
  One to 100 row objects keyed by column name. Omit a column to use its default, or `NULL` when it has none. Pass `null` to store `NULL` explicitly. Values must fit their column types. See [Data types](/reference/data-types).
</ParamField>

## Result

The inserted rows, including their generated `id` and `created_at`.

## Example

```json Arguments theme={null}
{
  "projectId": "01k7m3x9q2v8d4h6n1r5t0w2yz",
  "table": "books",
  "rows": [
    { "title": "Piranesi", "finished": true, "rating": 5, "details": { "tags": ["fiction"] } },
    { "title": "Middlemarch", "finished": false }
  ]
}
```

```json Result theme={null}
{
  "data": [
    {
      "id": "0b7c1f7e-6f0e-4d3a-9a51-2f7c3d1b8e44",
      "created_at": "2026-10-14T16:02:11.482Z",
      "title": "Piranesi",
      "finished": true,
      "rating": 5,
      "details": { "tags": ["fiction"] }
    },
    {
      "id": "4d9e7a1c-2b6f-4e8d-b3a5-7c1f9e2d4b6a",
      "created_at": "2026-10-14T16:02:11.482Z",
      "title": "Middlemarch",
      "finished": false,
      "rating": null,
      "details": null
    }
  ]
}
```

## Errors

| Code | When |
| - | - |
| `ACCESS_DENIED` | You don't have write access, or the connection is read-only |
| `VALIDATION` | Unknown table or column, more than 100 rows, a value that doesn't fit its type, a missing required value, a value over 16 KB, a row over 64 KB, or a foreign key value that doesn't match a row |
| `CONFLICT` | An `id` you supplied already exists |
| `QUOTA_EXCEEDED` | The project's storage is full |

## Notes

* You can supply your own `id` (a UUID) and `created_at` values. Otherwise they are generated.
* All rows in a call are inserted together, so a single invalid row rejects the whole batch. The error message names the problem column.
* Rows inserted in the same call share the same `created_at` value.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.