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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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)
Behavior2/5

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

No annotations are provided, so the description carries full burden but only states the action without behavioral details. It doesn't disclose aspects like authentication needs, rate limits, pagination (implied by 'limit' parameter), or what the search returns (e.g., structured data vs. raw results), which are critical for a search tool.

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, making it highly concise. It's front-loaded with the core action, though this brevity contributes to gaps in other dimensions.

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 likely defines return values), the description's minimalism is partially offset. However, for a search tool with 2 parameters, 0% schema coverage, and no annotations, it lacks essential context like search scope, result format hints, or error handling, making it incomplete for effective use.

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 description must compensate but adds no parameter information. It doesn't explain what 'query' should contain (e.g., search terms, filters) or how 'limit' works (e.g., max results, default behavior), leaving parameters undocumented beyond the schema's basic types.

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

Purpose3/5

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

The description states the verb 'search' and resource 'entities in New Relic', which gives a basic purpose. However, it lacks specificity about what 'entities' means (e.g., servers, applications, users) and doesn't distinguish it from sibling tools like 'list_applications' or 'query_nrql', making it vague in context.

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?

No guidance is provided on when to use this tool versus alternatives such as 'list_applications' for specific entity types or 'query_nrql' for more complex queries. The description implies a general search but offers no context or exclusions, leaving usage unclear.

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