|
| 1 | +--- |
| 2 | +title: Netlify |
| 3 | +description: Manage Netlify sites, deploys, and environment variables |
| 4 | +--- |
| 5 | + |
| 6 | +import { BlockInfoCard } from "@/components/ui/block-info-card" |
| 7 | + |
| 8 | +<BlockInfoCard |
| 9 | + type="netlify" |
| 10 | + color="#00C7B7" |
| 11 | +/> |
| 12 | + |
| 13 | +## Usage Instructions |
| 14 | + |
| 15 | +Trigger and inspect Netlify deploys (builds), and manage account or site-scoped environment variables. Generate a Personal Access Token at https://app.netlify.com/user/applications#personal-access-tokens. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## Tools |
| 20 | + |
| 21 | +### `netlify_list_sites` |
| 22 | + |
| 23 | +List Netlify sites accessible to the authenticated user |
| 24 | + |
| 25 | +#### Input |
| 26 | + |
| 27 | +| Parameter | Type | Required | Description | |
| 28 | +| --------- | ---- | -------- | ----------- | |
| 29 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 30 | +| `name` | string | No | Filter sites by name | |
| 31 | +| `filter` | string | No | Filter scope: all, owner, or guest | |
| 32 | +| `page` | number | No | Page number \(1-indexed\) | |
| 33 | +| `perPage` | number | No | Results per page \(max 100\) | |
| 34 | + |
| 35 | +#### Output |
| 36 | + |
| 37 | +| Parameter | Type | Description | |
| 38 | +| --------- | ---- | ----------- | |
| 39 | +| `sites` | array | List of Netlify sites | |
| 40 | +| ↳ `id` | string | Site ID | |
| 41 | +| ↳ `name` | string | Site name | |
| 42 | +| ↳ `url` | string | Primary site URL | |
| 43 | +| ↳ `sslUrl` | string | HTTPS site URL | |
| 44 | +| ↳ `adminUrl` | string | Netlify admin URL | |
| 45 | +| ↳ `customDomain` | string | Custom domain | |
| 46 | +| ↳ `accountId` | string | Owning account ID | |
| 47 | +| ↳ `accountSlug` | string | Owning account slug | |
| 48 | +| ↳ `createdAt` | string | Creation timestamp | |
| 49 | +| ↳ `updatedAt` | string | Last update timestamp | |
| 50 | +| `count` | number | Number of sites returned | |
| 51 | + |
| 52 | +### `netlify_list_deploys` |
| 53 | + |
| 54 | +List deploys for a Netlify site |
| 55 | + |
| 56 | +#### Input |
| 57 | + |
| 58 | +| Parameter | Type | Required | Description | |
| 59 | +| --------- | ---- | -------- | ----------- | |
| 60 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 61 | +| `siteId` | string | Yes | Site ID or primary domain | |
| 62 | +| `state` | string | No | Filter by deploy state: ready, error, building, enqueued, processing, uploading, new | |
| 63 | +| `branch` | string | No | Filter by git branch | |
| 64 | +| `production` | string | No | Filter to production deploys only \("true" or "false"\) | |
| 65 | +| `page` | number | No | Page number \(1-indexed\) | |
| 66 | +| `perPage` | number | No | Results per page \(max 100\) | |
| 67 | + |
| 68 | +#### Output |
| 69 | + |
| 70 | +| Parameter | Type | Description | |
| 71 | +| --------- | ---- | ----------- | |
| 72 | +| `deploys` | array | List of deploys | |
| 73 | +| ↳ `id` | string | Deploy ID | |
| 74 | +| ↳ `siteId` | string | Site ID | |
| 75 | +| ↳ `state` | string | Deploy state: new, enqueued, building, uploading, processing, ready, error, retrying | |
| 76 | +| ↳ `name` | string | Site name | |
| 77 | +| ↳ `url` | string | Site URL | |
| 78 | +| ↳ `deployUrl` | string | Unique deploy URL | |
| 79 | +| ↳ `deploySslUrl` | string | Unique deploy HTTPS URL | |
| 80 | +| ↳ `adminUrl` | string | Netlify admin URL | |
| 81 | +| ↳ `branch` | string | Git branch | |
| 82 | +| ↳ `context` | string | Deploy context: production, deploy-preview, branch-deploy | |
| 83 | +| ↳ `commitRef` | string | Git commit SHA | |
| 84 | +| ↳ `commitUrl` | string | Git commit URL | |
| 85 | +| ↳ `errorMessage` | string | Error message if failed | |
| 86 | +| ↳ `createdAt` | string | Creation timestamp | |
| 87 | +| ↳ `updatedAt` | string | Last update timestamp | |
| 88 | +| ↳ `publishedAt` | string | Publish timestamp | |
| 89 | +| `count` | number | Number of deploys returned | |
| 90 | + |
| 91 | +### `netlify_get_deploy` |
| 92 | + |
| 93 | +Get details of a specific Netlify deploy |
| 94 | + |
| 95 | +#### Input |
| 96 | + |
| 97 | +| Parameter | Type | Required | Description | |
| 98 | +| --------- | ---- | -------- | ----------- | |
| 99 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 100 | +| `deployId` | string | Yes | Deploy ID | |
| 101 | + |
| 102 | +#### Output |
| 103 | + |
| 104 | +| Parameter | Type | Description | |
| 105 | +| --------- | ---- | ----------- | |
| 106 | +| `id` | string | Deploy ID | |
| 107 | +| `siteId` | string | Site ID | |
| 108 | +| `state` | string | Deploy state | |
| 109 | +| `name` | string | Site name | |
| 110 | +| `url` | string | Site URL | |
| 111 | +| `deployUrl` | string | Unique deploy URL | |
| 112 | +| `deploySslUrl` | string | Unique deploy HTTPS URL | |
| 113 | +| `adminUrl` | string | Netlify admin URL | |
| 114 | +| `branch` | string | Git branch | |
| 115 | +| `context` | string | Deploy context | |
| 116 | +| `commitRef` | string | Git commit SHA | |
| 117 | +| `commitUrl` | string | Git commit URL | |
| 118 | +| `errorMessage` | string | Error message if failed | |
| 119 | +| `createdAt` | string | Creation timestamp | |
| 120 | +| `updatedAt` | string | Last update timestamp | |
| 121 | +| `publishedAt` | string | Publish timestamp | |
| 122 | + |
| 123 | +### `netlify_create_deploy` |
| 124 | + |
| 125 | +Trigger a new Netlify deploy by starting a build for a site (optionally from a specific branch) |
| 126 | + |
| 127 | +#### Input |
| 128 | + |
| 129 | +| Parameter | Type | Required | Description | |
| 130 | +| --------- | ---- | -------- | ----------- | |
| 131 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 132 | +| `siteId` | string | Yes | Site ID or primary domain to deploy | |
| 133 | +| `branch` | string | No | Git branch to build from \(defaults to the site’s configured production branch\) | |
| 134 | +| `title` | string | No | Optional human-readable label shown in the deploy log | |
| 135 | +| `clearCache` | string | No | Clear the build cache before deploying \("true" or "false"\) | |
| 136 | + |
| 137 | +#### Output |
| 138 | + |
| 139 | +| Parameter | Type | Description | |
| 140 | +| --------- | ---- | ----------- | |
| 141 | +| `id` | string | Build ID | |
| 142 | +| `deployId` | string | Deploy ID produced by this build \(use to poll status\) | |
| 143 | +| `siteId` | string | Site ID | |
| 144 | +| `sha` | string | Git commit SHA being built | |
| 145 | +| `done` | boolean | Whether the build has completed | |
| 146 | +| `error` | string | Build error if any | |
| 147 | +| `createdAt` | string | Creation timestamp | |
| 148 | + |
| 149 | +### `netlify_cancel_deploy` |
| 150 | + |
| 151 | +Cancel an in-progress Netlify deploy |
| 152 | + |
| 153 | +#### Input |
| 154 | + |
| 155 | +| Parameter | Type | Required | Description | |
| 156 | +| --------- | ---- | -------- | ----------- | |
| 157 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 158 | +| `deployId` | string | Yes | Deploy ID to cancel | |
| 159 | + |
| 160 | +#### Output |
| 161 | + |
| 162 | +| Parameter | Type | Description | |
| 163 | +| --------- | ---- | ----------- | |
| 164 | +| `id` | string | Deploy ID | |
| 165 | +| `siteId` | string | Site ID | |
| 166 | +| `state` | string | Deploy state after cancellation | |
| 167 | +| `name` | string | Site name | |
| 168 | +| `url` | string | Site URL | |
| 169 | +| `deployUrl` | string | Unique deploy URL | |
| 170 | +| `deploySslUrl` | string | Unique deploy HTTPS URL | |
| 171 | +| `adminUrl` | string | Netlify admin URL | |
| 172 | +| `branch` | string | Git branch | |
| 173 | +| `context` | string | Deploy context | |
| 174 | +| `commitRef` | string | Git commit SHA | |
| 175 | +| `commitUrl` | string | Git commit URL | |
| 176 | +| `errorMessage` | string | Error message if failed | |
| 177 | +| `createdAt` | string | Creation timestamp | |
| 178 | +| `updatedAt` | string | Last update timestamp | |
| 179 | +| `publishedAt` | string | Publish timestamp | |
| 180 | + |
| 181 | +### `netlify_list_env_vars` |
| 182 | + |
| 183 | +List environment variables for an account, optionally scoped to a site |
| 184 | + |
| 185 | +#### Input |
| 186 | + |
| 187 | +| Parameter | Type | Required | Description | |
| 188 | +| --------- | ---- | -------- | ----------- | |
| 189 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 190 | +| `accountId` | string | Yes | Account ID or slug that owns the environment variables | |
| 191 | +| `siteId` | string | No | Optional site ID to scope variables to a specific site | |
| 192 | +| `contextName` | string | No | Filter by deploy context \(production, deploy-preview, branch-deploy, dev\) | |
| 193 | +| `scope` | string | No | Filter by scope \(builds, functions, runtime, post_processing\) | |
| 194 | + |
| 195 | +#### Output |
| 196 | + |
| 197 | +| Parameter | Type | Description | |
| 198 | +| --------- | ---- | ----------- | |
| 199 | +| `envVars` | array | List of environment variables | |
| 200 | +| ↳ `key` | string | Variable name | |
| 201 | +| ↳ `scopes` | array | Where the variable applies \(builds, functions, runtime, post_processing\) | |
| 202 | +| ↳ `values` | array | Per-context values | |
| 203 | +| ↳ `id` | string | Value ID | |
| 204 | +| ↳ `context` | string | Context name | |
| 205 | +| ↳ `contextParameter` | string | Branch name when context is branch-deploy | |
| 206 | +| ↳ `value` | string | Variable value | |
| 207 | +| ↳ `isSecret` | boolean | Whether the value is secret | |
| 208 | +| ↳ `updatedAt` | string | Last update timestamp | |
| 209 | +| `count` | number | Number of variables returned | |
| 210 | + |
| 211 | +### `netlify_create_env_var` |
| 212 | + |
| 213 | +Create a new environment variable for an account, optionally scoped to a site |
| 214 | + |
| 215 | +#### Input |
| 216 | + |
| 217 | +| Parameter | Type | Required | Description | |
| 218 | +| --------- | ---- | -------- | ----------- | |
| 219 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 220 | +| `accountId` | string | Yes | Account ID or slug that owns the variable | |
| 221 | +| `siteId` | string | No | Optional site ID to scope the variable to a specific site | |
| 222 | +| `key` | string | Yes | Variable name \(e.g., DATABASE_URL\) | |
| 223 | +| `value` | string | Yes | Variable value | |
| 224 | +| `context` | string | No | Deploy context this value applies to: all, production, deploy-preview, branch-deploy, dev \(default: all\) | |
| 225 | +| `scopes` | string | No | Comma-separated scopes \(builds, functions, runtime, post_processing\). Defaults to all scopes | |
| 226 | +| `isSecret` | string | No | Mark the value as secret \("true" or "false"\) | |
| 227 | + |
| 228 | +#### Output |
| 229 | + |
| 230 | +| Parameter | Type | Description | |
| 231 | +| --------- | ---- | ----------- | |
| 232 | +| `envVar` | object | Created environment variable | |
| 233 | +| ↳ `key` | string | Variable name | |
| 234 | +| ↳ `scopes` | array | Scopes | |
| 235 | +| ↳ `values` | array | Per-context values | |
| 236 | +| ↳ `id` | string | Value ID | |
| 237 | +| ↳ `context` | string | Context name | |
| 238 | +| ↳ `contextParameter` | string | Branch name for branch-deploy context | |
| 239 | +| ↳ `value` | string | Variable value | |
| 240 | +| ↳ `isSecret` | boolean | Whether the value is secret | |
| 241 | +| ↳ `updatedAt` | string | Last update timestamp | |
| 242 | + |
| 243 | +### `netlify_update_env_var` |
| 244 | + |
| 245 | +Replace an environment variable for an account, optionally scoped to a site |
| 246 | + |
| 247 | +#### Input |
| 248 | + |
| 249 | +| Parameter | Type | Required | Description | |
| 250 | +| --------- | ---- | -------- | ----------- | |
| 251 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 252 | +| `accountId` | string | Yes | Account ID or slug that owns the variable | |
| 253 | +| `siteId` | string | No | Optional site ID to scope the variable to a specific site | |
| 254 | +| `key` | string | Yes | Variable name to update | |
| 255 | +| `value` | string | Yes | New variable value \(replaces all existing values\) | |
| 256 | +| `context` | string | No | Deploy context: all, production, deploy-preview, branch-deploy, dev \(default: all\) | |
| 257 | +| `scopes` | string | No | Comma-separated scopes \(builds, functions, runtime, post_processing\) | |
| 258 | +| `isSecret` | string | No | Mark the value as secret \("true" or "false"\) | |
| 259 | + |
| 260 | +#### Output |
| 261 | + |
| 262 | +| Parameter | Type | Description | |
| 263 | +| --------- | ---- | ----------- | |
| 264 | +| `envVar` | object | Updated environment variable | |
| 265 | +| ↳ `key` | string | Variable name | |
| 266 | +| ↳ `scopes` | array | Scopes | |
| 267 | +| ↳ `values` | array | Per-context values | |
| 268 | +| ↳ `id` | string | Value ID | |
| 269 | +| ↳ `context` | string | Context name | |
| 270 | +| ↳ `contextParameter` | string | Branch name for branch-deploy context | |
| 271 | +| ↳ `value` | string | Variable value | |
| 272 | +| ↳ `isSecret` | boolean | Whether the value is secret | |
| 273 | +| ↳ `updatedAt` | string | Last update timestamp | |
| 274 | + |
| 275 | +### `netlify_delete_env_var` |
| 276 | + |
| 277 | +Delete an environment variable from an account, optionally scoped to a site |
| 278 | + |
| 279 | +#### Input |
| 280 | + |
| 281 | +| Parameter | Type | Required | Description | |
| 282 | +| --------- | ---- | -------- | ----------- | |
| 283 | +| `apiKey` | string | Yes | Netlify Personal Access Token | |
| 284 | +| `accountId` | string | Yes | Account ID or slug that owns the variable | |
| 285 | +| `siteId` | string | No | Optional site ID to scope deletion to a specific site | |
| 286 | +| `key` | string | Yes | Variable name to delete | |
| 287 | + |
| 288 | +#### Output |
| 289 | + |
| 290 | +| Parameter | Type | Description | |
| 291 | +| --------- | ---- | ----------- | |
| 292 | +| `deleted` | boolean | Whether the environment variable was deleted | |
| 293 | + |
| 294 | + |
0 commit comments