Files
sim/apps/sim/tools/vercel/delete_deployment.ts
Waleed 91aa1f9a52 feat(tools): added vercel block & tools (#3252)
* feat(vercel): add complete Vercel integration with 42 API tools

Add Vercel platform management integration covering deployments, projects,
environment variables, domains, DNS records, aliases, edge configs, and
team/user management. All tools use API key authentication with Bearer tokens.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(vercel): add webhook and deployment check tools

Add 8 new Vercel API tools:
- Webhooks: list, create, delete
- Deployment Checks: create, get, list, update, rerequest

Brings total Vercel tools to 50.

* fix(vercel): expand all object and array output definitions

Expand unexpanded output types:
- get_deployment: meta and gitSource objects now have properties
- list_deployment_files: children array now has items definition
- get_team: teamRoles and teamPermissions arrays now have items

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* update icon size, update docs

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 15:54:49 -08:00

78 lines
1.9 KiB
TypeScript

import type { ToolConfig } from '@/tools/types'
import type {
VercelDeleteDeploymentParams,
VercelDeleteDeploymentResponse,
} from '@/tools/vercel/types'
export const vercelDeleteDeploymentTool: ToolConfig<
VercelDeleteDeploymentParams,
VercelDeleteDeploymentResponse
> = {
id: 'vercel_delete_deployment',
name: 'Vercel Delete Deployment',
description: 'Delete a Vercel deployment',
version: '1.0.0',
params: {
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Vercel Access Token',
},
deploymentId: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'The deployment ID or URL to delete',
},
teamId: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Team ID to scope the request',
},
},
request: {
url: (params: VercelDeleteDeploymentParams) => {
const query = new URLSearchParams()
if (params.teamId) query.set('teamId', params.teamId.trim())
const id = params.deploymentId.trim()
if (id.includes('.')) {
query.set('url', id)
}
const qs = query.toString()
return `https://api.vercel.com/v13/deployments/${id}${qs ? `?${qs}` : ''}`
},
method: 'DELETE',
headers: (params: VercelDeleteDeploymentParams) => ({
Authorization: `Bearer ${params.apiKey}`,
'Content-Type': 'application/json',
}),
},
transformResponse: async (response: Response) => {
const data = await response.json()
return {
success: true,
output: {
uid: data.uid ?? data.id ?? null,
state: data.state ?? 'DELETED',
},
}
},
outputs: {
uid: {
type: 'string',
description: 'The removed deployment ID',
},
state: {
type: 'string',
description: 'Deployment state after deletion (DELETED)',
},
},
}