create_deployment
Record new application deployments in New Relic to track release changes, monitor performance impact, and maintain deployment history for better observability.
Instructions
Record a new deployment for an application
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes | ||
| revision | Yes | ||
| description | No | ||
| user | No | ||
| changelog | No |
Input Schema (JSON Schema)
{
"properties": {
"app_id": {
"title": "App Id",
"type": "string"
},
"changelog": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Changelog"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"revision": {
"title": "Revision",
"type": "string"
},
"user": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "User"
}
},
"required": [
"app_id",
"revision"
],
"type": "object"
}
Implementation Reference
- newrelic_mcp/server.py:507-531 (handler)MCP tool handler function that validates inputs, builds the deployment payload, calls the NewRelicClient method, and returns JSON response.@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)NewRelicClient helper method that performs the actual HTTP POST request to the New Relic API to create the 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})