Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

get_application_metrics

Retrieve available performance metrics for a New Relic application to monitor its health and analyze data trends.

Instructions

Get available metrics for an application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
namesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function for get_application_metrics. Handles input parameters, initializes client check, calls the NewRelicClient method, and returns JSON-formatted results or errors.
    @mcp.tool()
    async def get_application_metrics(
        app_id: str, names: Optional[List[str]] = None
    ) -> str:
        """Get available metrics for an application"""
        if not client:
            return json.dumps({"error": "New Relic client not initialized"})
    
        try:
            result = await client.get_application_metrics(app_id, names)
            return json.dumps(result, indent=2)
        except Exception as e:
            return json.dumps({"error": str(e)}, indent=2)
  • Core helper method in NewRelicClient class that constructs the API URL for application metrics and makes the HTTP GET request using _make_request.
    async def get_application_metrics(
        self, app_id: str, names: Optional[List[str]] = None
    ) -> Dict[str, Any]:
        """Get available metrics for an application"""
        url = f"{self.base_url}/applications/{app_id}/metrics.json"
        params = {}
        if names:
            params["name"] = ",".join(names)
        return await self._make_request("GET", url, params=params)
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 but offers minimal insight. It implies a read operation ('Get'), but doesn't cover aspects like authentication needs, rate limits, pagination, error handling, or what 'available metrics' includes (e.g., list, schema). This is inadequate for a tool with parameters and potential complexity.

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 ('Get available metrics'), making it easy to parse. Every word contributes directly to the purpose, achieving optimal conciseness for such a brief statement.

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), 2 parameters with 0% schema coverage, and no annotations, the description is minimally adequate but incomplete. It covers the basic purpose but lacks details on usage, parameters, and behavior, leaving gaps that could hinder effective tool invocation.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter details. The description mentions 'an application' (hinting at 'app_id') but doesn't explain 'names' (e.g., whether it filters metrics by name). It adds minimal value beyond the schema's structural information, failing to compensate for the coverage gap.

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 clearly states the verb 'Get' and resource 'available metrics for an application', making the purpose understandable. It distinguishes from siblings like 'get_application_metric_data' (which likely retrieves actual metric values) by focusing on available metrics. However, it could be more specific about what 'available metrics' entails (e.g., metadata, types, or definitions).

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 sibling tools like 'get_application_metric_data' (for metric data) or 'get_application' (for general app info), nor does it specify prerequisites or contexts for usage. This leaves the agent without clear direction on tool selection.

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