Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

get_application_metric_data

Retrieve application performance metrics from New Relic monitoring to analyze application health, track key performance indicators, and monitor system behavior over specified time periods.

Instructions

Get metric data for an application

Input Schema

NameRequiredDescriptionDefault
app_idYes
metric_namesYes
from_timeNo
to_timeNo

Input Schema (JSON Schema)

{ "properties": { "app_id": { "title": "App Id", "type": "string" }, "from_time": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "From Time" }, "metric_names": { "items": { "type": "string" }, "title": "Metric Names", "type": "array" }, "to_time": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "To Time" } }, "required": [ "app_id", "metric_names" ], "type": "object" }

Implementation Reference

  • MCP tool handler function that wraps the client method to fetch and return application metric data as JSON.
    @mcp.tool() async def get_application_metric_data( app_id: str, metric_names: List[str], from_time: Optional[str] = None, to_time: Optional[str] = None, ) -> str: """Get metric data for an application""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.get_application_metric_data( app_id, metric_names, from_time, to_time ) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
  • NewRelicClient helper method that makes the HTTP request to New Relic API for application metric data.
    async def get_application_metric_data( self, app_id: str, metric_names: List[str], from_time: Optional[str] = None, to_time: Optional[str] = None, ) -> Dict[str, Any]: """Get metric data for an application""" url = f"{self.base_url}/applications/{app_id}/metrics/data.json" params = {"names": metric_names} if from_time: params["from"] = from_time if to_time: params["to"] = to_time return await self._make_request("GET", url, params=params)

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