listDeploymentFiles
Retrieve and view deployment files using a deployment ID with Vercel MCP. Access specific files associated with a deployment for streamlined management and troubleshooting.
Instructions
Lists deployment files
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deploymentId | Yes | The ID of the deployment | |
| slug | No | Slug | |
| teamId | No | Team ID |
Implementation Reference
- src/vercel/deployments.ts:126-144 (handler)Core handler function that lists files for a Vercel deployment using the Vercel SDK and formats the response.export async function listDeploymentFiles( env: Env, deploymentId: string, options?: { teamId?: string slug?: string } ) { const vercel = new Vercel({ bearerToken: env.VERCEL_API_TOKEN }) const response = await vercel.deployments.listDeploymentFiles({ id: deploymentId, ...options }) return MCPResponse(response) }
- src/index.ts:178-182 (schema)Zod input schema defining parameters for the listDeploymentFiles tool.{ deploymentId: z.string().describe("The ID of the deployment"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") },
- src/index.ts:175-209 (registration)Registers the listDeploymentFiles tool with the MCP server using server.tool, including description, schema, and error-handling wrapper that calls the core handler.server.tool( "listDeploymentFiles", "Lists deployment files", { deploymentId: z.string().describe("The ID of the deployment"), 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 listDeploymentFiles(env, deploymentId, options) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error listing deployment files:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error listing deployment files: ${errorMessage}` } ] } } } )
- src/utils.ts:1-13 (helper)Utility function used by handlers to format API responses as MCP-compatible content blocks.export function MCPResponse(data: unknown) { return { content: [ { type: "text", text: typeof data === "string" ? data : JSON.stringify(data, null, 2) } ] } }