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") },

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