Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

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
NameRequiredDescriptionDefault
app_idYes
revisionYes
descriptionNo
userNo
changelogNo

Implementation Reference

  • 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)
  • 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})

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piekstra/newrelic-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server