list_deployments
Retrieve deployment history for a New Relic application to track changes and monitor release cycles.
Instructions
List deployments for an application
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes |
Implementation Reference
- newrelic_mcp/server.py:494-505 (handler)The main MCP tool handler and registration for 'list_deployments'. This function is decorated with @mcp.tool() and implements the tool logic by calling the NewRelicClient's list_deployments method and returning JSON.@mcp.tool() async def list_deployments(app_id: str) -> str: """List deployments for an application""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.list_deployments(app_id) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- newrelic_mcp/server.py:146-150 (helper)Helper method in NewRelicClient class that performs the actual API request to fetch deployments for a given application ID.async def list_deployments(self, app_id: str) -> Dict[str, Any]: """List deployments for an application""" url = f"{self.base_url}/applications/{app_id}/deployments.json" return await self._make_request("GET", url)