list_deployments
Retrieve deployment history for a New Relic application to monitor release changes and track deployment timelines.
Instructions
List deployments for an application
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"app_id": {
"title": "App Id",
"type": "string"
}
},
"required": [
"app_id"
],
"type": "object"
}
Implementation Reference
- newrelic_mcp/server.py:494-505 (handler)The main MCP tool handler for 'list_deployments'. This function is decorated with @mcp.tool(), handles input validation implicitly via type hints, calls the NewRelicClient helper, and returns JSON-formatted results or errors.@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-149 (helper)Supporting method in NewRelicClient class that performs the actual HTTP GET request to the New Relic API endpoint for listing deployments of a specific application.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)