data
Vercel Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Vercel KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.vercel.*.
Use lua_read_doc("integrations.vercel") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Vercel workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.vercel.create_deployment({name = "example_name", files = "example_files", git_source = "example_git_source", target = "example_target", framework = "example_framework", regions = "example_regions", project_settings = "example_project_settings", team_id = "example_team_id"}))' --json kosmo integrations:lua --eval 'print(docs.read("vercel"))' --json
kosmo integrations:lua --eval 'print(docs.read("vercel.create_deployment"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local vercel = app.integrations.vercel
local result = vercel.create_deployment({name = "example_name", files = "example_files", git_source = "example_git_source", target = "example_target", framework = "example_framework", regions = "example_regions", project_settings = "example_project_settings", team_id = "example_team_id"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.vercel, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.vercel.default.* or app.integrations.vercel.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Vercel, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Vercel Integration
The Vercel integration provides tools to manage your Vercel projects, deployments, domains, and teams.
Authentication
You need a Vercel API token (Bearer token). Generate one at vercel.com/account/tokens.
The token is sent as a Bearer header on every request. Ensure it has the scopes required for the operations you plan to use.
Projects
List Projects
local projects = app.integrations.vercel.vercel_list_projects({
limit = 20,
team_id = "team_xxx" -- optional
})
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Max projects to return (default 20, max 100) |
team_id | string | No | Scope to a specific team |
Get Project
local project = app.integrations.vercel.vercel_get_project({
id = "prj_xxx"
})
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The project ID |
team_id | string | No | Team ID if project belongs to team |
Deployments
Create Deployment
local deployment = app.integrations.vercel.vercel_create_deployment({
name = "my-project",
git_source = {
type = "github",
ref = "main",
repoId = 12345
},
target = "preview",
team_id = "team_xxx" -- optional
})
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project name to deploy |
files | array | No | File objects for direct-upload deployments |
git_source | object | No | Git source reference |
target | string | No | production or preview |
framework | string | No | Framework preset slug |
regions | array | No | Region codes |
project_settings | object | No | Deployment project settings override |
team_id | string | No | Scope to a specific team |
slug | string | No | Scope to a specific team slug |
List Deployments
local deployments = app.integrations.vercel.vercel_list_deployments({
project_id = "prj_xxx", -- optional
state = "READY", -- optional: READY, ERROR, BUILDING, QUEUED
target = "production", -- optional: production, preview, development
limit = 20,
team_id = "team_xxx" -- optional
})
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | No | Filter by project ID |
state | string | No | Filter by state (READY, ERROR, BUILDING, QUEUED) |
target | string | No | Filter by target (production, preview, development) |
limit | integer | No | Max deployments to return (default 20, max 100) |
team_id | string | No | Scope to a specific team |
Get Deployment
local deployment = app.integrations.vercel.vercel_get_deployment({
id = "dpl_xxx"
})
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The deployment ID |
team_id | string | No | Team ID if deployment belongs to team |
Domains
List Domains
local domains = app.integrations.vercel.vercel_list_domains({
limit = 20,
team_id = "team_xxx" -- optional
})
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Max domains to return (default 20, max 100) |
team_id | string | No | Scope to a specific team |
Teams
List Teams
local teams = app.integrations.vercel.vercel_list_teams({
limit = 20
})
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Max teams to return (default 20, max 100) |
User
Get Current User
local user = app.integrations.vercel.vercel_get_current_user({})
Returns the authenticated user profile including username, email, and plan details. No parameters required.
Pagination
List endpoints (list_projects, list_deployments, list_domains, list_teams) support a limit parameter. Use smaller limits for faster responses. Vercel may return a pagination object with next cursors for fetching additional pages.
Notes
- All API calls use the Vercel v2 REST API (
https://api.vercel.com/v2). - The integration calls Vercel’s versioned REST endpoints under
https://api.vercel.com, including/v10/projects,/v9/projects/{idOrName},/v6/deployments,/v13/deployments,/v5/domains,/v2/teams, and/v2/user. - Token scopes determine which resources are accessible. A Full Account token provides access to all endpoints.
- The
team_idparameter is optional for personal accounts but required when accessing team-scoped resources.
Multi-Account Usage
You can configure multiple Vercel accounts (e.g., personal and team):
-- Default account
local projects = app.integrations.vercel.vercel_list_projects({})
-- Named account
local projects = app.integrations.vercel.vercel_list_projects({
account = "my-team"
})Raw agent markdown
# Vercel Integration
The Vercel integration provides tools to manage your Vercel projects, deployments, domains, and teams.
## Authentication
You need a **Vercel API token** (Bearer token). Generate one at [vercel.com/account/tokens](https://vercel.com/account/tokens).
The token is sent as a `Bearer` header on every request. Ensure it has the scopes required for the operations you plan to use.
---
## Projects
### List Projects
```lua
local projects = app.integrations.vercel.vercel_list_projects({
limit = 20,
team_id = "team_xxx" -- optional
})
```
| Parameter | Type | Required | Description |
|-----------|----------|----------|---------------------------------------------|
| `limit` | integer | No | Max projects to return (default 20, max 100)|
| `team_id` | string | No | Scope to a specific team |
### Get Project
```lua
local project = app.integrations.vercel.vercel_get_project({
id = "prj_xxx"
})
```
| Parameter | Type | Required | Description |
|-----------|--------|----------|-----------------------------------|
| `id` | string | Yes | The project ID |
| `team_id` | string | No | Team ID if project belongs to team|
---
## Deployments
### Create Deployment
```lua
local deployment = app.integrations.vercel.vercel_create_deployment({
name = "my-project",
git_source = {
type = "github",
ref = "main",
repoId = 12345
},
target = "preview",
team_id = "team_xxx" -- optional
})
```
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Project name to deploy |
| `files` | array | No | File objects for direct-upload deployments |
| `git_source` | object | No | Git source reference |
| `target` | string | No | `production` or `preview` |
| `framework` | string | No | Framework preset slug |
| `regions` | array | No | Region codes |
| `project_settings` | object | No | Deployment project settings override |
| `team_id` | string | No | Scope to a specific team |
| `slug` | string | No | Scope to a specific team slug |
### List Deployments
```lua
local deployments = app.integrations.vercel.vercel_list_deployments({
project_id = "prj_xxx", -- optional
state = "READY", -- optional: READY, ERROR, BUILDING, QUEUED
target = "production", -- optional: production, preview, development
limit = 20,
team_id = "team_xxx" -- optional
})
```
| Parameter | Type | Required | Description |
|--------------|---------|----------|----------------------------------------------------------|
| `project_id` | string | No | Filter by project ID |
| `state` | string | No | Filter by state (READY, ERROR, BUILDING, QUEUED) |
| `target` | string | No | Filter by target (production, preview, development) |
| `limit` | integer | No | Max deployments to return (default 20, max 100) |
| `team_id` | string | No | Scope to a specific team |
### Get Deployment
```lua
local deployment = app.integrations.vercel.vercel_get_deployment({
id = "dpl_xxx"
})
```
| Parameter | Type | Required | Description |
|-----------|--------|----------|----------------------------------------|
| `id` | string | Yes | The deployment ID |
| `team_id` | string | No | Team ID if deployment belongs to team |
---
## Domains
### List Domains
```lua
local domains = app.integrations.vercel.vercel_list_domains({
limit = 20,
team_id = "team_xxx" -- optional
})
```
| Parameter | Type | Required | Description |
|-----------|----------|----------|--------------------------------------------|
| `limit` | integer | No | Max domains to return (default 20, max 100)|
| `team_id` | string | No | Scope to a specific team |
---
## Teams
### List Teams
```lua
local teams = app.integrations.vercel.vercel_list_teams({
limit = 20
})
```
| Parameter | Type | Required | Description |
|-----------|----------|----------|-----------------------------------------|
| `limit` | integer | No | Max teams to return (default 20, max 100)|
---
## User
### Get Current User
```lua
local user = app.integrations.vercel.vercel_get_current_user({})
```
Returns the authenticated user profile including username, email, and plan details. No parameters required.
---
## Pagination
List endpoints (`list_projects`, `list_deployments`, `list_domains`, `list_teams`) support a `limit` parameter. Use smaller limits for faster responses. Vercel may return a `pagination` object with `next` cursors for fetching additional pages.
---
## Notes
- All API calls use the Vercel v2 REST API (`https://api.vercel.com/v2`).
- The integration calls Vercel's versioned REST endpoints under `https://api.vercel.com`, including `/v10/projects`, `/v9/projects/{idOrName}`, `/v6/deployments`, `/v13/deployments`, `/v5/domains`, `/v2/teams`, and `/v2/user`.
- Token scopes determine which resources are accessible. A **Full Account** token provides access to all endpoints.
- The `team_id` parameter is optional for personal accounts but required when accessing team-scoped resources.
## Multi-Account Usage
You can configure multiple Vercel accounts (e.g., personal and team):
```lua
-- Default account
local projects = app.integrations.vercel.vercel_list_projects({})
-- Named account
local projects = app.integrations.vercel.vercel_list_projects({
account = "my-team"
})
``` local result = app.integrations.vercel.create_deployment({name = "example_name", files = "example_files", git_source = "example_git_source", target = "example_target", framework = "example_framework", regions = "example_regions", project_settings = "example_project_settings", team_id = "example_team_id"})
print(result) Functions
create_deployment Write
Create a new deployment on Vercel. Provide a project name and either file contents or a Git source reference. Returns the new deployment ID and URL.
- Lua path
app.integrations.vercel.create_deployment- Full name
vercel.vercel_create_deployment
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The project name to deploy to (must match an existing Vercel project). |
files | array | no | Array of file objects with "file" (path) and "content" (base64-encoded or sha+size). Required for direct uploads. |
git_source | object | no | Git source reference, e.g. {"type": "github", "ref": "main", "repoId": 12345}. Alternative to files. |
target | string | no | Deployment target: "production" or "preview" (default: "preview"). |
framework | string | no | Framework preset slug (e.g., "nextjs", "remix", "nuxtjs"). |
regions | array | no | List of region codes to deploy to (e.g., ["iad1", "sfo1"]). |
project_settings | object | no | Override project settings for this deployment (buildCommand, outputDirectory, installCommand, etc.). |
team_id | string | no | Optional team ID to create the deployment under. |
slug | string | no | Optional team slug to create the deployment under. |
get_current_user Read
Get the currently authenticated Vercel user profile, including username, email, and plan.
- Lua path
app.integrations.vercel.get_current_user- Full name
vercel.vercel_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_deployment Read
Get details for a specific Vercel deployment by ID, including status, URL, and build logs.
- Lua path
app.integrations.vercel.get_deployment- Full name
vercel.vercel_get_deployment
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The deployment ID. |
team_id | string | no | Optional team ID if the deployment belongs to a team. |
slug | string | no | Optional team slug if the deployment belongs to a team. |
get_project Read
Get details for a specific Vercel project by ID, including framework, domains, and settings.
- Lua path
app.integrations.vercel.get_project- Full name
vercel.vercel_get_project
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The project ID. |
team_id | string | no | Optional team ID if the project belongs to a team. |
slug | string | no | Optional team slug if the project belongs to a team. |
list_deployments Read
List deployments across your Vercel projects. Filter by project, state, or target.
- Lua path
app.integrations.vercel.list_deployments- Full name
vercel.vercel_list_deployments
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | no | Filter deployments by project ID. |
state | string | no | Filter by deployment state (e.g., READY, ERROR, BUILDING, QUEUED). |
target | string | no | Filter by target environment (e.g., production, preview, development). |
limit | integer | no | Maximum number of deployments to return (default 20, max 100). |
team_id | string | no | Optional team ID to scope deployments to a specific team. |
slug | string | no | Optional team slug to scope deployments to a specific team. |
list_domains Read
List all domains configured in Vercel, including verification and DNS status.
- Lua path
app.integrations.vercel.list_domains- Full name
vercel.vercel_list_domains
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of domains to return (default 20, max 100). |
team_id | string | no | Optional team ID to scope domains to a specific team. |
slug | string | no | Optional team slug to scope domains to a specific team. |
list_projects Read
List all Vercel projects. Returns project names, IDs, framework, and deployment status.
- Lua path
app.integrations.vercel.list_projects- Full name
vercel.vercel_list_projects
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of projects to return (default 20, max 100). |
team_id | string | no | Optional team ID to scope projects to a specific team. |
slug | string | no | Optional team slug to scope projects to a specific team. |
list_teams Read
List all Vercel teams you belong to, including membership roles and member counts.
- Lua path
app.integrations.vercel.list_teams- Full name
vercel.vercel_list_teams
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of teams to return (default 20, max 100). |