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

# drop_table

> Permanently delete a table and all of its rows.

Deletes a table, its definition, and every row in it.

| | |
| - | - |
| Scope | `mcp:write` |
| Annotations | `destructiveHint: true` |
| Activity event | `table.dropped` |

<Warning>
  The table and its rows can't be recovered. Export the table first if you might need it. See [Export to CSV](/app/export).
</Warning>

## Parameters

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

<ParamField body="table" type="string" required>
  The table to drop.
</ParamField>

## Result

<ResponseField name="dropped" type="string">
  The name of the dropped table.
</ResponseField>

## Example

```json Arguments theme={null}
{ "projectId": "01k7m3x9q2v8d4h6n1r5t0w2yz", "table": "scratch_import" }
```

```json Result theme={null}
{ "data": { "dropped": "scratch_import" } }
```

## Errors

| Code | When |
| - | - |
| `ACCESS_DENIED` | You don't have write access, or the connection is read-only |
| `VALIDATION` | The table doesn't exist, or another table has a foreign key to it |

## Tables referenced by foreign keys

You can't drop a table while another table has a foreign key that points at it. The error names the referencing column:

```text theme={null}
Table "companies" is referenced by "contacts"."company_id"; drop that column or table first
```

Drop that column with [`drop_column`](/mcp/tools/drop-column), or drop the referencing table first. A foreign key from a table to itself doesn't block dropping it.


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