create_deployment
Record a new application deployment in New Relic to track releases, monitor performance changes, and maintain deployment history.
Instructions
Record a new deployment for an application
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| revision | Yes | ||
| description | No | ||
| user | No | ||
| changelog | No |
Implementation Reference
- newrelic_mcp/server.py:507-531 (handler)MCP tool handler function that implements the 'create_deployment' tool. It builds the deployment dictionary from parameters and delegates to the NewRelicClient helper method.@mcp.tool() async def create_deployment( app_id: str, revision: str, description: Optional[str] = None, user: Optional[str] = None, changelog: Optional[str] = None, ) -> str: """Record a new deployment for an application""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: deployment = {"revision": revision} if description: deployment["description"] = description if user: deployment["user"] = user if changelog: deployment["changelog"] = changelog result = await client.create_deployment(app_id, deployment) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- newrelic_mcp/server.py:151-156 (helper)Supporting utility method in the NewRelicClient class that performs the actual HTTP POST request to the New Relic API to create a deployment.async def create_deployment( self, app_id: str, deployment: Dict[str, Any] ) -> Dict[str, Any]: """Record a new deployment for an application""" url = f"{self.base_url}/applications/{app_id}/deployments.json" return await self._make_request("POST", url, json={"deployment": deployment})