Skip to main content
Glama

deleteDeployment

Remove a specific deployment by its ID using Vercel MCP. This tool enables efficient cleanup of deployments while requiring the deployment identifier as input.

Instructions

Deletes a deployment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deploymentIdYesThe ID of the deployment to delete
slugNoSlug
teamIdNoTeam ID
urlNoThe URL of the deployment

Implementation Reference

  • The handler function for the MCP 'deleteDeployment' tool. It creates the environment with API token, calls the underlying deleteDeployment helper, formats the result as JSON text response, and handles errors.
    async ({ deploymentId, ...options }) => { try { const env = { VERCEL_API_TOKEN: apiKey } const result = await deleteDeployment(env, deploymentId, options) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error deleting deployment:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error deleting deployment: ${errorMessage}` } ] } } }
  • Zod input schema defining parameters for the deleteDeployment tool: deploymentId (required), url/teamId/slug (optional).
    deploymentId: z.string().describe("The ID of the deployment to delete"), url: z.string().optional().describe("The URL of the deployment"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") },
  • src/index.ts:313-348 (registration)
    Registration of the 'deleteDeployment' tool on the MCP server using server.tool(name, description, inputSchema, handlerFn).
    server.tool( "deleteDeployment", "Deletes a deployment", { deploymentId: z.string().describe("The ID of the deployment to delete"), url: z.string().optional().describe("The URL of the deployment"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") }, async ({ deploymentId, ...options }) => { try { const env = { VERCEL_API_TOKEN: apiKey } const result = await deleteDeployment(env, deploymentId, options) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error deleting deployment:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error deleting deployment: ${errorMessage}` } ] } } } )
  • Helper function that performs the actual deletion using Vercel SDK. Imported and called by the MCP tool handler.
    export async function deleteDeployment( env: Env, deploymentId: string, options?: { url?: string teamId?: string slug?: string } ) { const vercel = new Vercel({ bearerToken: env.VERCEL_API_TOKEN }) const response = await vercel.deployments.deleteDeployment({ id: deploymentId, ...options }) return MCPResponse(response) }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zueai/vercel-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server