Skip to main content
Glama

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
NameRequiredDescriptionDefault
deploymentIdYesThe ID of the deployment
slugNoSlug
teamIdNoTeam ID

Implementation Reference

  • 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)
    }
  • 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}`
    					}
    				]
    			}
    		}
    	}
    )
  • 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)
    			}
    		]
    	}
    }
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