getDeployments
Retrieve a list of deployments from Vercel based on criteria like application name, project ID, timestamp range, deployment state, or team ID for efficient deployment monitoring and management.
Instructions
Lists deployments
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | Application name | |
| from | No | Timestamp to list deployments from | |
| limit | No | Limit on number of deployments to return | |
| projectId | No | Project ID | |
| since | No | Timestamp to get deployments from | |
| slug | No | Slug | |
| state | No | Deployment state | |
| target | No | Deployment target | |
| teamId | No | Team ID | |
| to | No | Timestamp to list deployments until | |
| until | No | Timestamp to get deployments until | |
| users | No | Filter by users |
Implementation Reference
- src/vercel/deployments.ts:182-208 (handler)Core handler function that executes the logic to retrieve deployments using the Vercel SDK.export async function getDeployments( env: Env, options?: { app?: string from?: number limit?: number projectId?: string target?: string to?: number users?: string since?: number until?: number state?: string teamId?: string slug?: string } ) { const vercel = new Vercel({ bearerToken: env.VERCEL_API_TOKEN }) const response = await vercel.deployments.getDeployments({ ...options }) return MCPResponse(response) }
- src/index.ts:253-311 (registration)MCP server registration of the 'getDeployments' tool, including schema and wrapper handler that calls the core function.server.tool( "getDeployments", "Lists deployments", { app: z.string().optional().describe("Application name"), from: z .number() .optional() .describe("Timestamp to list deployments from"), limit: z .number() .optional() .describe("Limit on number of deployments to return"), projectId: z.string().optional().describe("Project ID"), target: z.string().optional().describe("Deployment target"), to: z .number() .optional() .describe("Timestamp to list deployments until"), users: z.string().optional().describe("Filter by users"), since: z .number() .optional() .describe("Timestamp to get deployments from"), until: z .number() .optional() .describe("Timestamp to get deployments until"), state: z.string().optional().describe("Deployment state"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") }, async (options) => { try { const env = { VERCEL_API_TOKEN: apiKey } const result = await getDeployments(env, options) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error getting deployments:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error getting deployments: ${errorMessage}` } ] } } } )
- src/index.ts:257-284 (schema)Zod input schema definition for the getDeployments tool parameters.app: z.string().optional().describe("Application name"), from: z .number() .optional() .describe("Timestamp to list deployments from"), limit: z .number() .optional() .describe("Limit on number of deployments to return"), projectId: z.string().optional().describe("Project ID"), target: z.string().optional().describe("Deployment target"), to: z .number() .optional() .describe("Timestamp to list deployments until"), users: z.string().optional().describe("Filter by users"), since: z .number() .optional() .describe("Timestamp to get deployments from"), until: z .number() .optional() .describe("Timestamp to get deployments until"), state: z.string().optional().describe("Deployment state"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") },