Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

search_entities

Find and identify New Relic monitoring entities using search queries to locate applications, hosts, services, and infrastructure components within your observability environment.

Instructions

Search for entities in New Relic

Input Schema

NameRequiredDescriptionDefault
queryYes
limitNo

Input Schema (JSON Schema)

{ "properties": { "limit": { "default": 25, "title": "Limit", "type": "integer" }, "query": { "title": "Query", "type": "string" } }, "required": [ "query" ], "type": "object" }

Implementation Reference

  • MCP tool handler that executes the search_entities tool by calling the NewRelicClient method and formatting the JSON response.
    @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)
  • Helper method in NewRelicClient class that performs the actual GraphQL query to search for entities in New Relic.
    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