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 for system events.

Instructions

Get details for a specific alert policy

Input Schema

NameRequiredDescriptionDefault
policy_idYes

Input Schema (JSON Schema)

{ "properties": { "policy_id": { "title": "Policy Id", "type": "string" } }, "required": [ "policy_id" ], "type": "object" }

Implementation Reference

  • MCP tool handler function for get_alert_policy. Takes policy_id as input, calls the NewRelicClient's get_alert_policy method, and returns the result as formatted JSON or an 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)
  • NewRelicClient helper method that performs the actual HTTP GET request to the New Relic API endpoint for retrieving a specific alert policy by ID.
    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