list_alert_policies
Retrieve all alert policies configured in New Relic to monitor application performance and infrastructure health.
Instructions
List all alert policies
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- newrelic_mcp/server.py:377-387 (handler)MCP tool handler for list_alert_policies: checks client initialization, calls the client's list_alert_policies method, formats result as JSON, handles errors.@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-109 (helper)NewRelicClient helper method implementing the core API logic: makes GET request to New Relic's /alerts_policies.json endpoint.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)