Skip to main content
Glama
New Relic MCP Server

New Relic MCP Server

by piekstra

Generate Log Parsing Rule

generate_log_parsing_rule

Create a log parsing rule from an NRQL query or sample log messages to extract structured fields from New Relic logs.

Instructions

Generate a log parsing rule from either a query or provided samples.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "generate_log_parsing_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
log_queryNoOptional NRQL WHERE clause to fetch logs (e.g., "service = 'api'")
account_idNoOptional account ID (uses default if not provided)
time_rangeNoTime range for log query (default: "1 hour ago")1 hour ago
field_hintsNoOptional hints for field types (e.g., {"user_id": "UUID"})
log_samplesNoOptional list of log message samples

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv1.3.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / account_id / description
      Added value: +"Optional account ID (uses default if not provided)"
    • removedInput schema / properties / account_id / title
      Removed value: -"Account Id"
    • addedInput schema / properties / field_hints / description
      Added value: +"Optional hints for field types (e.g., {\"user_id\": \"UUID\"})"
    • removedInput schema / properties / field_hints / title
      Removed value: -"Field Hints"
    • addedInput schema / properties / log_query / description
      Added value: +"Optional NRQL WHERE clause to fetch logs (e.g., \"service = 'api'\")"
    • removedInput schema / properties / log_query / title
      Removed value: -"Log Query"
    • addedInput schema / properties / log_samples / description
      Added value: +"Optional list of log message samples"
    • removedInput schema / properties / log_samples / title
      Removed value: -"Log Samples"
    • addedInput schema / properties / time_range / description
      Added value: +"Time range for log query (default: \"1 hour ago\")"
    • removedInput schema / properties / time_range / title
      Removed value: -"Time Range"
    • removedInput schema / title
      Removed value: -"generate_log_parsing_ruleArguments"
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"generate_log_parsing_ruleOutput"
    • addedOutput schema / x-fastmcp-wrap-result
      Added value: +true
  2. Changed1 schema field changedv1.0.0
    • addedInput schema / title
      Added value: +"generate_log_parsing_ruleArguments"
  3. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It never says whether generated rules are persisted or only returned as a draft, whether the tool reads logs against the account (a billable/query action), or what is required if neither query nor samples are given. These are exactly the traits an agent needs before calling it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler, and the dual input mode is stated up front. It is efficient, though so terse that the brevity edges toward under-specification rather than optimal conciseness.

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?

An output schema exists, so return-value explanation is not required, and all parameters are optional and fully documented in the schema. What is missing is behavioral context: whether the result is saved, what happens when both or neither of log_query/log_samples are supplied, and how this differs from the sibling create_log_parsing_rule.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all five parameters are already documented with defaults and examples. The description adds only the loose mapping of 'query' to log_query and 'samples' to log_samples, adding no syntax, precedence, or interaction details beyond the schema. Baseline 3 applies.

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

Purpose4/5

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

The description names a specific verb and resource ('Generate a log parsing rule') and distinguishes the two input modes (NRQL query vs. supplied samples). It is clearly separable from list/create/update/delete_log_parsing_rule, though the 'generate' vs. 'create' distinction is never made explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'from either a query or provided samples' implies the two input paths are alternatives, which is useful routing information. However, there is no guidance on when to choose generate_log_parsing_rule versus create_log_parsing_rule or test_log_parsing_rule, and no stated preconditions for either mode.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.