Skip to main content
Glama

getDeploymentFileContents

Retrieve contents of specific files within a deployment by providing deployment and file IDs, enabling direct access to essential data for management and troubleshooting.

Instructions

Gets deployment file contents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deploymentIdYesThe ID of the deployment
fileIdYesThe ID of the file
slugNoSlug
teamIdNoTeam ID

Implementation Reference

  • src/index.ts:211-251 (registration)
    Registration of the 'getDeploymentFileContents' MCP tool, including description, input schema, and handler function.
    server.tool( "getDeploymentFileContents", "Gets deployment file contents", { deploymentId: z.string().describe("The ID of the deployment"), fileId: z.string().describe("The ID of the file"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") }, async ({ deploymentId, fileId, ...options }) => { try { const env = { VERCEL_API_TOKEN: apiKey } const result = await getDeploymentFileContents( env, deploymentId, fileId, options ) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error getting deployment file contents:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error getting deployment file contents: ${errorMessage}` } ] } } } )
  • The handler function for the tool that prepares the environment, calls the helper function, and returns the result as MCP content or handles errors.
    async ({ deploymentId, fileId, ...options }) => { try { const env = { VERCEL_API_TOKEN: apiKey } const result = await getDeploymentFileContents( env, deploymentId, fileId, options ) return { content: [ { type: "text", text: JSON.stringify(result, null, 2) } ] } } catch (error: unknown) { console.error("Error getting deployment file contents:", error) const errorMessage = error instanceof Error ? error.message : String(error) return { content: [ { type: "text", text: `Error getting deployment file contents: ${errorMessage}` } ] } } }
  • Zod schema defining the input parameters for the getDeploymentFileContents tool.
    { deploymentId: z.string().describe("The ID of the deployment"), fileId: z.string().describe("The ID of the file"), teamId: z.string().optional().describe("Team ID"), slug: z.string().optional().describe("Slug") },
  • Helper function that creates Vercel SDK client and calls getDeploymentFileContents to fetch the file contents, wrapping in MCPResponse.
    export async function getDeploymentFileContents( env: Env, deploymentId: string, fileId: string, options?: { teamId?: string slug?: string } ) { const vercel = new Vercel({ bearerToken: env.VERCEL_API_TOKEN }) const response = await vercel.deployments.getDeploymentFileContents({ id: deploymentId, fileId: fileId, ...options }) return MCPResponse(response) }

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