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

TableJSON Schema
NameRequiredDescriptionDefault
deploymentIdYesThe ID of the deployment to cancel
slugNoSlug
teamIdNoTeam ID

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)
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'cancels' implying a mutation, but doesn't specify if this is reversible, requires specific permissions, affects ongoing processes, or has side effects like notifications. This leaves significant gaps for a tool that likely modifies state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence ('Cancels a deployment'), which is front-loaded and wastes no words. It efficiently conveys the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a cancellation operation (likely a mutation with no output schema and no annotations), the description is incomplete. It doesn't address behavioral aspects like effects, prerequisites, or return values, making it inadequate for safe and informed tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter descriptions in the schema (e.g., 'The ID of the deployment to cancel'). The description adds no additional parameter details beyond what the schema provides, so it meets the baseline for high schema coverage without adding value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('cancels') and resource ('a deployment'), providing a specific action. However, it doesn't differentiate from the sibling 'deleteDeployment' tool, which suggests a similar destructive operation but with potentially different semantics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'deleteDeployment' or other sibling tools. The description lacks context about prerequisites, conditions for cancellation, or any exclusions, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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