Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

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
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)
  • 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)
  • Registration of the list_alert_policies tool via the @mcp.tool() decorator on the FastMCP instance.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'List all alert policies' implies a read-only operation, it doesn't specify whether this requires authentication, includes pagination, returns a specific format, or has rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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. It's front-loaded with the core action ('List all alert policies'), making it easy to parse. Every word earns its place by conveying essential information.

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's simplicity (0 parameters, 100% schema coverage, and an output schema exists), the description is minimally adequate. However, with no annotations and a read operation, it should ideally mention authentication needs or return format hints. The output schema reduces the burden, but the description could be more complete for standalone use.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it doesn't introduce any confusion. A baseline of 4 is appropriate since there's nothing to compensate for.

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

Purpose4/5

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

The description 'List all alert policies' clearly states the verb ('List') and resource ('alert policies'), making the purpose immediately understandable. It distinguishes from siblings like 'get_alert_policy' (singular) by specifying 'all' policies. However, it doesn't explicitly differentiate from other list tools (e.g., 'list_applications'), so it's not a perfect 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'list_alert_policies' over 'get_alert_policy' (for a single policy) or other list tools, nor does it specify any prerequisites or contextual constraints for usage.

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