Skip to main content
Glama
piekstra

New Relic MCP Server

by piekstra

delete_log_parsing_rule

Remove log parsing rules from New Relic monitoring to clean up log processing configurations and maintain organized log management.

Instructions

Delete a log parsing rule

Input Schema

NameRequiredDescriptionDefault
rule_idYes
account_idNo

Input Schema (JSON Schema)

{ "properties": { "account_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Account Id" }, "rule_id": { "title": "Rule Id", "type": "string" } }, "required": [ "rule_id" ], "type": "object" }

Implementation Reference

  • MCP tool handler for deleting a log parsing rule. Decorated with @mcp.tool() for automatic registration and handles input validation, client checks, and delegates to the helper function.
    @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 helper function that executes the GraphQL mutation to delete the specified log parsing rule via New Relic's 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

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