create_deployment
Creates a deployment marker for an APM application to track releases and changes.
Instructions
Create a deployment marker for an APM application (REST v2).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application_id | Yes | ||
| revision | Yes | ||
| changelog | No | ||
| description | No | ||
| user | No | ||
| region | No |
Implementation Reference
- src/tools/rest/deployments.ts:52-65 (handler)The `create` method on `RestDeploymentsTool` class that executes the create_deployment logic. It builds a POST request to /applications/{id}/deployments with the deployment payload (revision, changelog, description, user) via the NewRelicRestClient.
async create(args: CreateDeploymentArgs): Promise<unknown> { const client = this.restFor(args.region); const path = `/applications/${args.application_id}/deployments`; const payload = { deployment: { revision: args.revision, changelog: args.changelog, description: args.description, user: args.user, }, }; const res = await client.post<unknown>(path, payload); return { ...res }; } - src/tools/rest/deployments.ts:4-11 (schema)The TypeScript type `CreateDeploymentArgs` defining input parameters: application_id (number), revision (string), optional changelog, description, user, and region.
type CreateDeploymentArgs = { application_id: number; revision: string; changelog?: string; description?: string; user?: string; region?: Region; }; - src/tools/rest/deployments.ts:33-49 (schema)The `getCreateTool()` method returns the Tool definition with name 'create_deployment', description, and inputSchema (JSON schema) specifying required application_id and revision, plus optional fields.
getCreateTool(): Tool { return { name: 'create_deployment', description: 'Create a deployment marker for an APM application (REST v2).', inputSchema: { type: 'object', properties: { application_id: { type: 'number' }, revision: { type: 'string' }, changelog: { type: 'string' }, description: { type: 'string' }, user: { type: 'string' }, region: { type: 'string', enum: ['US', 'EU'] }, }, required: ['application_id', 'revision'], }, }; - src/server.ts:175-178 (registration)Registration in the executeTool switch-case that maps the string 'create_deployment' to instantiate RestDeploymentsTool and call its create method.
case 'create_deployment': return await new RestDeploymentsTool().create( args as Parameters<RestDeploymentsTool['create']>[0] ); - src/server.ts:81-82 (registration)Tool registration in registerTools() where restDeployments.getCreateTool() is added to the tools list for MCP tool discovery.
restDeployments.getCreateTool(), restDeployments.getListTool(),