delete_deployment
Remove deployment records from New Relic to manage application lifecycle and maintain accurate monitoring data.
Instructions
Delete a deployment record (REST v2). Requires admin role permissions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application_id | Yes | ||
| id | Yes | ||
| confirm | Yes | ||
| region | No |
Implementation Reference
- src/tools/rest/deployments.ts:129-137 (handler)The primary handler function that validates the confirmation flag and performs the DELETE request to the New Relic REST API endpoint for deployments.async delete(args: DeleteDeploymentArgs): Promise<unknown> { if (args.confirm !== true) { throw new Error('delete_deployment: confirm must be true'); } const client = this.restFor(args.region); const path = `/applications/${args.application_id}/deployments/${args.id}`; const res = await client.delete<unknown>(path); return { ...res }; }
- src/tools/rest/deployments.ts:20-25 (schema)TypeScript type definition for the input parameters expected by the delete_deployment handler.type DeleteDeploymentArgs = { application_id: number; id: number; confirm: true; region?: Region; };
- src/tools/rest/deployments.ts:112-127 (registration)Method that returns the MCP Tool object for 'delete_deployment', including name, description, and input schema for validation.getDeleteTool(): Tool { return { name: 'delete_deployment', description: 'Delete a deployment record (REST v2). Requires admin role permissions.', inputSchema: { type: 'object', properties: { application_id: { type: 'number' }, id: { type: 'number' }, confirm: { type: 'boolean' }, region: { type: 'string', enum: ['US', 'EU'] }, }, required: ['application_id', 'id', 'confirm'], }, }; }
- src/server.ts:81-83 (registration)Includes the getDeleteTool() in the array of tools registered with the MCP server.restDeployments.getCreateTool(), restDeployments.getListTool(), restDeployments.getDeleteTool(),
- src/server.ts:183-186 (handler)Server-side dispatch logic that routes 'delete_deployment' tool calls to the RestDeploymentsTool instance's delete method.case 'delete_deployment': return await new RestDeploymentsTool().delete( args as Parameters<RestDeploymentsTool['delete']>[0] );