create_deployment
Use this REST v2 tool to mark deployments for APM applications by specifying application ID, revision, and optional details like changelog, description, user, and region.
Instructions
Create a deployment marker for an APM application (REST v2).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application_id | Yes | ||
| changelog | No | ||
| description | No | ||
| region | No | ||
| revision | Yes | ||
| user | No |
Implementation Reference
- src/tools/rest/deployments.ts:52-65 (handler)The handler function that implements the core logic of the 'create_deployment' tool by making a POST request to the New Relic REST API to create a deployment marker.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:33-50 (schema)Defines the tool specification including name, description, and input schema for 'create_deployment'.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)Registers the handler dispatch in the server's executeTool switch statement, instantiating the tool and calling its create method.case 'create_deployment': return await new RestDeploymentsTool().create( args as Parameters<RestDeploymentsTool['create']>[0] );
- src/server.ts:81-81 (registration)Registers the tool definition (from getCreateTool()) into the server's tools map.restDeployments.getCreateTool(),
- src/tools/rest/deployments.ts:4-11 (schema)TypeScript type definition for the input arguments used by the create handler.type CreateDeploymentArgs = { application_id: number; revision: string; changelog?: string; description?: string; user?: string; region?: Region; };