delete_deployment
Remove a deployment record via REST v2 on the New Relic MCP Server. Requires admin permissions, application ID, record ID, and confirmation for execution.
Instructions
Delete a deployment record (REST v2). Requires admin role permissions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application_id | Yes | ||
| confirm | Yes | ||
| id | Yes | ||
| region | No |
Implementation Reference
- src/tools/rest/deployments.ts:129-137 (handler)Core handler function implementing the delete_deployment tool logic: checks confirmation, constructs REST path, calls delete API, returns response.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 }; }
- Tool definition method providing name, description, and input schema for delete_deployment.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/tools/rest/deployments.ts:20-25 (schema)TypeScript type definition for input arguments, enforcing confirm: true.type DeleteDeploymentArgs = { application_id: number; id: number; confirm: true; region?: Region; };
- src/server.ts:81-83 (registration)Registration of REST deployments tools, including delete_deployment, into the tools list.restDeployments.getCreateTool(), restDeployments.getListTool(), restDeployments.getDeleteTool(),
- src/server.ts:183-186 (handler)Server-side dispatcher that invokes the delete handler for delete_deployment tool calls.case 'delete_deployment': return await new RestDeploymentsTool().delete( args as Parameters<RestDeploymentsTool['delete']>[0] );