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)
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('Gets') without any details on permissions, rate limits, error handling, or what the output looks like (e.g., file format, size limits). For a read operation with multiple parameters, this is inadequate and leaves critical behavioral traits unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single phrase 'Gets deployment file contents', which is overly concise to the point of under-specification. It lacks structure and fails to front-load useful information, such as purpose or context, making it inefficient despite its brevity. Every sentence should earn its place, but this one doesn't provide enough value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (4 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'deployment file contents' entails (e.g., raw data, metadata), how to handle the optional parameters ('slug' and 'teamId'), or any behavioral aspects. This leaves significant gaps for the agent to infer usage and outcomes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for all parameters (e.g., 'deploymentId' as 'The ID of the deployment', 'fileId' as 'The ID of the file'). The description adds no additional meaning beyond this, such as explaining relationships between parameters (e.g., 'slug' and 'teamId' might be optional for scoping). Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Gets deployment file contents' is a tautology that essentially restates the tool name 'getDeploymentFileContents' without adding meaningful specificity. It doesn't distinguish this tool from sibling tools like 'getDeployment' or 'listDeploymentFiles' beyond the obvious implication of file contents versus deployment metadata or file listings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions, such as how it differs from 'getDeployment' (which might return metadata) or 'listDeploymentFiles' (which might list files without contents). This leaves the agent with no usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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