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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a read operation ('Get'), but doesn't mention authentication needs, rate limits, error conditions, or what the output contains. This leaves significant gaps for a tool with an output schema but no behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it appropriately sized and front-loaded. Every word contributes directly to stating the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), one simple parameter, and no annotations, the description is minimally adequate but incomplete. It lacks behavioral details and usage guidance, making it just sufficient for basic understanding but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no meaning beyond the input schema, which has 0% description coverage for the single parameter 'policy_id'. However, with only one parameter and a clear title ('Policy Id'), the schema is minimal, so the baseline is 3 as the description doesn't compensate but the burden is low.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get details for a specific alert policy' clearly states the verb ('Get') and resource ('alert policy'), but it's vague about what 'details' entail and doesn't distinguish it from sibling tools like 'list_alert_policies'. It provides a basic purpose but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'list_alert_policies' for multiple policies or other get_* tools for different resources. The description implies usage for a specific policy but offers no explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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