list_alert_policies
Retrieve all alert policies from New Relic to monitor and manage application performance and infrastructure health.
Instructions
List all alert policies
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- newrelic_mcp/server.py:377-388 (handler)MCP tool handler function decorated with @mcp.tool() that executes the list_alert_policies tool logic by calling the NewRelicClient method and returning formatted JSON response.@mcp.tool() async def list_alert_policies() -> str: """List all alert policies""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.list_alert_policies() return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
- newrelic_mcp/server.py:106-110 (helper)Helper method in NewRelicClient class that makes the HTTP GET request to the New Relic API endpoint for listing alert policies.async def list_alert_policies(self) -> Dict[str, Any]: """List all alert policies""" url = f"{self.base_url}/alerts_policies.json" return await self._make_request("GET", url)
- newrelic_mcp/server.py:377-377 (registration)Registration of the list_alert_policies tool via the @mcp.tool() decorator on the FastMCP instance.@mcp.tool()