Skip to main content
Glama

getDeploymentEvents

Retrieve deployment events by deployment ID and build ID, filter by name, status code, or timestamp, and specify retrieval direction or limit for precise tracking and analysis.

Instructions

Gets deployment events by deployment ID and build ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildsNoBuilds parameter
delimiterNoDelimiter for events
deploymentIdYesThe ID or URL of the deployment
directionNoDirection of events retrieval
followNoFollow parameter for events
limitNoLimit on number of events to return
nameNoFilter events by name
sinceNoTimestamp to get events from
slugNoSlug
statusCodeNoFilter events by status code
teamIdNoTeam ID
untilNoTimestamp to get events until

Implementation Reference

  • Core implementation of getDeploymentEvents: fetches deployment events from Vercel API using fetch with constructed query parameters.
    export async function getDeploymentEvents(
    	env: Env,
    	deploymentId: string,
    	options?: {
    		direction?: "forward" | "backward"
    		limit?: number
    		name?: string
    		since?: number
    		until?: number
    		statusCode?: string
    		delimiter?: number
    		builds?: number
    		teamId?: string
    		slug?: string
    	}
    ) {
    	// Construct the URL for the Vercel API endpoint
    	let url = `https://api.vercel.com/v3/deployments/${deploymentId}/events`
    
    	// Create the query parameters
    	const params = new URLSearchParams()
    	params.append("follow", "0") // Always set follow=0 as requested
    
    	// Add other optional parameters
    	if (options?.direction) params.append("direction", options.direction)
    	if (options?.limit) params.append("limit", options.limit.toString())
    	if (options?.name) params.append("name", options.name)
    	if (options?.since) params.append("since", options.since.toString())
    	if (options?.until) params.append("until", options.until.toString())
    	if (options?.statusCode) params.append("statusCode", options.statusCode)
    	if (options?.delimiter)
    		params.append("delimiter", options.delimiter.toString())
    	if (options?.builds) params.append("builds", options.builds.toString())
    	if (options?.teamId) params.append("teamId", options.teamId)
    	if (options?.slug) params.append("slug", options.slug)
    
    	// Append the query parameters to the URL
    	url = `${url}?${params.toString()}`
    
    	// Make the fetch request
    	const response = await fetch(url, {
    		headers: {
    			Authorization: `Bearer ${env.VERCEL_API_TOKEN}`,
    			"Content-Type": "application/json"
    		}
    	})
    
    	// Parse the response as JSON
    	const data = await response.json()
    
    	return MCPResponse(data)
    }
  • src/index.ts:45-97 (registration)
    MCP server tool registration for 'getDeploymentEvents', including input schema with Zod validation and wrapper handler that calls the core function.
    server.tool(
    	"getDeploymentEvents",
    	"Gets deployment events by deployment ID and build ID",
    	{
    		deploymentId: z.string().describe("The ID or URL of the deployment"),
    		direction: z
    			.enum(["forward", "backward"])
    			.optional()
    			.describe("Direction of events retrieval"),
    		follow: z.number().optional().describe("Follow parameter for events"),
    		limit: z
    			.number()
    			.optional()
    			.describe("Limit on number of events to return"),
    		name: z.string().optional().describe("Filter events by name"),
    		since: z.number().optional().describe("Timestamp to get events from"),
    		until: z.number().optional().describe("Timestamp to get events until"),
    		statusCode: z
    			.string()
    			.optional()
    			.describe("Filter events by status code"),
    		delimiter: z.number().optional().describe("Delimiter for events"),
    		builds: z.number().optional().describe("Builds parameter"),
    		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 getDeploymentEvents(env, deploymentId, options)
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(result, null, 2)
    					}
    				]
    			}
    		} catch (error: unknown) {
    			console.error("Error getting deployment events:", error)
    			const errorMessage =
    				error instanceof Error ? error.message : String(error)
    			return {
    				content: [
    					{
    						type: "text",
    						text: `Error getting deployment events: ${errorMessage}`
    					}
    				]
    			}
    		}
    	}
    )
  • Input schema for getDeploymentEvents tool using Zod for parameter validation.
    	deploymentId: z.string().describe("The ID or URL of the deployment"),
    	direction: z
    		.enum(["forward", "backward"])
    		.optional()
    		.describe("Direction of events retrieval"),
    	follow: z.number().optional().describe("Follow parameter for events"),
    	limit: z
    		.number()
    		.optional()
    		.describe("Limit on number of events to return"),
    	name: z.string().optional().describe("Filter events by name"),
    	since: z.number().optional().describe("Timestamp to get events from"),
    	until: z.number().optional().describe("Timestamp to get events until"),
    	statusCode: z
    		.string()
    		.optional()
    		.describe("Filter events by status code"),
    	delimiter: z.number().optional().describe("Delimiter for events"),
    	builds: z.number().optional().describe("Builds parameter"),
    	teamId: z.string().optional().describe("Team ID"),
    	slug: z.string().optional().describe("Slug")
    },
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 but provides minimal information. It states the tool 'gets' events, implying a read operation, but doesn't describe what format the events come in, whether there's pagination, rate limits, authentication requirements, or what happens when parameters are omitted. For a tool with 12 parameters and no annotation coverage, this is a significant gap in behavioral context.

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

Conciseness4/5

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

The description is extremely concise - a single sentence that gets straight to the point. There's no wasted verbiage or unnecessary elaboration. However, the potential confusion around 'build ID' versus the actual 'builds' parameter slightly reduces the effectiveness of this conciseness.

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 tool's complexity (12 parameters, no output schema, no annotations), the description is inadequate. It doesn't explain what 'deployment events' actually are, what format they return in, or how the various filtering parameters interact. The mention of 'build ID' that doesn't correspond to a schema parameter creates confusion. For a tool with this level of complexity and no structured output information, the description should provide more contextual guidance.

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?

The schema description coverage is 100%, so all parameters have descriptions in the schema itself. The tool description mentions 'deployment ID and build ID', but 'build ID' doesn't match the schema's 'builds' parameter (which is described as 'Builds parameter' with no further clarification). This creates confusion rather than adding value. The description doesn't provide additional context about parameter interactions or usage patterns beyond what's already in the schema.

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

Purpose3/5

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

The description states the tool 'gets deployment events by deployment ID and build ID', which provides a clear verb ('gets') and resource ('deployment events'). However, it mentions 'build ID' which doesn't correspond to any parameter in the schema (the schema has 'builds' as a number parameter, not 'build ID'), creating potential confusion. It doesn't distinguish this tool from its sibling 'getDeployment' or explain what makes 'events' different from general deployment information.

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?

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling tools related to deployments (getDeployment, getDeployments, listDeploymentFiles), but the description doesn't explain when an agent should choose this specific events-focused tool over those other options. No context about prerequisites or typical use cases is provided.

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