# autofit_sheet_columns (https://sellersheetai.com/docs/mcp-api/tools/autofit_sheet_columns)

> Auto-resize columns to fit their content — wraps Sheets `autoResizeDimensions`.

Access: **WRITE** · toolset google_workspace · family null

No more guessing pixel widths.

## Call it

MCP tool call:

```json
{
  "name": "autofit_sheet_columns",
  "arguments": {
    "spreadsheet_id": "<spreadsheet_id>",
    "sheet_name": "<sheet_name>"
  }
}
```

Tool API (early access — contact us):

```bash
curl -X POST https://api.sellersheetai.com/api/v1/tools/autofit_sheet_columns \
  -H "Authorization: Bearer $SELLERSHEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spreadsheet_id":"<spreadsheet_id>","sheet_name":"<sheet_name>"}'
```

## Arguments

| Name | Type | Required | Description |
|---|---|---|---|
| `spreadsheet_id` | string | yes | the spreadsheet ID (from its URL or get_sheet_metadata). |
| `sheet_name` | string | yes | the tab name. |
| `start_col` | integer |  | 0-based start column index. Default 0 (column A). |
| `end_col` | integer |  | 0-based exclusive end. None = autofit every column the tab has (uses gridProperties.columnCount). |

## Result

- `data.startCol / data.endCol` — the column span fitted (0-based, end exclusive).
- `data.sheetId` — the tab's id.

## Example

- # autofit columns A–F autofit_sheet_columns("1ABC...", "Summary", start_col=0, end_col=6) # autofit the whole tab autofit_sheet_columns("1ABC...", "Summary")