Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

search_entities

Find New Relic monitoring entities using search queries to identify applications, hosts, services, or other monitored components for observability analysis.

Instructions

Search for entities in New Relic

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
limitNo

Implementation Reference

  • MCP tool handler function for 'search_entities'. Handles client initialization check, calls the underlying client method, and returns JSON-formatted results or errors.
    @mcp.tool() async def search_entities(query: str, limit: int = 25) -> str: """Search for entities in New Relic""" if not client: return json.dumps({"error": "New Relic client not initialized"}) try: result = await client.search_entities(query, limit) return json.dumps(result, indent=2) except Exception as e: return json.dumps({"error": str(e)}, indent=2)
  • NewRelicClient helper method that executes the GraphQL query for searching entities via NerdGraph API.
    async def search_entities(self, query: str, limit: int = 25) -> Dict[str, Any]: """Search for entities in New Relic""" gql_query = """ query($query: String!, $limit: Int!) { actor { entitySearch(query: $query) { results(limit: $limit) { entities { guid name type entityType domain tags { key values } } } } } } """ variables = {"query": query, "limit": limit} return await self.nerdgraph_query(gql_query, variables)

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