Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

get_alert_policy

Retrieve alert policy details from New Relic to monitor application performance and configure notification rules.

Instructions

Get details for a specific alert policy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policy_idYes

Implementation Reference

  • The MCP tool handler function for 'get_alert_policy'. It checks if the client is initialized, calls the client's get_alert_policy method, and returns the JSON-formatted result or error.
    @mcp.tool() async def get_alert_policy(policy_id: str) -> str: """Get details for a specific alert policy""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.get_alert_policy(policy_id) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
  • Helper method in the NewRelicClient class that constructs the API URL and makes the GET request to retrieve the specific alert policy details from New Relic API.
    async def get_alert_policy(self, policy_id: str) -> Dict[str, Any]: """Get details for a specific alert policy""" url = f"{self.base_url}/alerts_policies/{policy_id}.json" return await self._make_request("GET", url)

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