Skip to main content
Glama

cancelDeployment

Stop an active deployment by specifying the deployment ID using this tool. It ensures resource efficiency and prevents unnecessary processes by halting deployments in progress.

Instructions

Cancels a deployment

Input Schema

NameRequiredDescriptionDefault
deploymentIdYesThe ID of the deployment to cancel
slugNoSlug
teamIdNoTeam ID

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "deploymentId": { "description": "The ID of the deployment to cancel", "type": "string" }, "slug": { "description": "Slug", "type": "string" }, "teamId": { "description": "Team ID", "type": "string" } }, "required": [ "deploymentId" ], "type": "object" }

Implementation Reference

  • The MCP tool handler function for 'cancelDeployment'. It constructs the environment with API key, calls the cancelDeployment helper, and returns the result or error in MCP format.
    async ({ deploymentId, ...options }) => { try { const env = { VERCEL_API_TOKEN: apiKey } const result = await cancelDeployment(env, deploymentId, options) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error canceling deployment:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error canceling deployment: ${errorMessage}` } ] } } }
  • Zod input schema defining parameters for the cancelDeployment tool: deploymentId (required), teamId and slug (optional).
    deploymentId: z.string().describe("The ID of the deployment to cancel"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") },
  • src/index.ts:139-173 (registration)
    Registration of the 'cancelDeployment' tool on the MCP server, including name, description, input schema, and handler function.
    server.tool( "cancelDeployment", "Cancels a deployment", { deploymentId: z.string().describe("The ID of the deployment to cancel"), 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 cancelDeployment(env, deploymentId, options) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error canceling deployment:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error canceling deployment: ${errorMessage}` } ] } } } )
  • Helper function that initializes the Vercel SDK client using the API token and calls the SDK's cancelDeployment method, wrapping the response with MCPResponse.
    export async function cancelDeployment( env: Env, deploymentId: string, options?: { teamId?: string slug?: string } ) { const vercel = new Vercel({ bearerToken: env.VERCEL_API_TOKEN }) const response = await vercel.deployments.cancelDeployment({ 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