Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

delete_log_parsing_rule

Remove a log parsing rule from New Relic to stop processing logs according to specific patterns.

Instructions

Delete a log parsing rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rule_idYes
account_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool registration and handler for 'delete_log_parsing_rule'. Validates inputs, initializes client/account, calls core delete function from log_parsing module, and formats response as JSON.
    @mcp.tool()
    async def delete_log_parsing_rule(
        rule_id: str, account_id: Optional[str] = None
    ) -> str:
        """Delete a log parsing rule"""
        if not client:
            return json.dumps({"error": "New Relic client not initialized"})
    
        acct_id = account_id or client.account_id
        if not acct_id:
            return json.dumps({"error": "Account ID required but not provided"})
    
        try:
            success = await log_parsing.delete_log_parsing_rule(client, acct_id, rule_id)
            return json.dumps({"success": success}, indent=2)
        except Exception as e:
            return json.dumps({"error": str(e)}, indent=2)
  • Core handler function that executes the GraphQL mutation to delete the specified log parsing rule using the New Relic NerdGraph API.
    async def delete_log_parsing_rule(client, account_id: str, rule_id: str) -> bool:
        """Delete a log parsing rule"""
        mutation = f"""
        mutation {{
            logConfigurationsDeleteParsingRule(
                accountId: {int(account_id)},
                id: "{rule_id}"
            ) {{
                errors {{
                    message
                    type
                }}
            }}
        }}
        """
    
        result = await client.nerdgraph_query(mutation)
    
        if result and "data" in result:
            delete_result = result["data"].get("logConfigurationsDeleteParsingRule", {})
            if delete_result.get("errors"):
                raise Exception(f"Failed to delete rule: {delete_result['errors']}")
            return True
    
        return False
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states 'Delete' which implies a destructive mutation, but doesn't disclose critical behavioral traits: whether deletion is permanent or reversible, authentication requirements, rate limits, side effects (e.g., impact on logs), or error handling. This leaves significant gaps for safe agent use.

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 zero waste—it directly states the tool's action and resource. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a destructive tool with no annotations, 2 parameters (0% schema coverage), and an output schema (which might help), the description is incomplete. It lacks behavioral context, parameter guidance, and usage rules, making it insufficient for safe and effective agent 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 description must compensate for undocumented parameters. It adds no meaning beyond the schema—doesn't explain what 'rule_id' or 'account_id' represent, their formats, or how to obtain them (e.g., from 'list_log_parsing_rules'). With 2 parameters and low coverage, this is inadequate.

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 'Delete a log parsing rule' clearly states the action (delete) and resource (log parsing rule), which is better than a tautology. However, it doesn't differentiate from sibling tools like 'update_log_parsing_rule' or 'test_log_parsing_rule' beyond the verb, and it lacks specificity about what deletion entails (permanent vs. soft, scope, etc.).

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 prerequisites (e.g., needing an existing rule), exclusions, or related tools like 'list_log_parsing_rules' for selection. Usage is implied only by the verb 'delete,' with no explicit context.

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