Skip to main content
Glama
Amazon EMR Log Analysis MCP Server

Amazon EMR Log Analysis MCP Server

by aws-samples

Analyze Emr Cluster Logs

analyze_emr_cluster_logs

Analyzes Amazon EMR cluster logs with Athena to identify known issues across Spark, YARN, Hadoop, and related components, returning evidence and troubleshooting links.

Instructions

Analyze EMR cluster logs using Amazon Athena.

This tool connects to an EMR cluster's logs in S3 and runs Athena queries to identify known issues based on a comprehensive knowledge base of curated EMR issues.

Prerequisites

  • EMR cluster with logging enabled to S3

  • AWS credentials with permissions for EMR, Athena, and S3

  • Athena query result location configured

Response Format

The response includes detailed findings with:

  • Issue summary and description

  • Component classification (Spark, YARN, Hadoop, etc.)

  • Occurrence count and sample log evidence

  • AWS Knowledge Center links when available for additional guidance

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cluster_id": "<cluster_id>"
    },
    "name": "analyze_emr_cluster_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
regionNoAWS region where the cluster is located. If not provided, uses AWS_DEFAULT_REGION environment variable or defaults to us-east-1.
cluster_idYesEMR cluster ID to analyze (e.g., j-12FTFQ3AGIYQ4). Must be a valid cluster with logging enabled to S3. The tool will connect to the cluster's S3 logs and perform Athena queries to identify known issues.
time_windowNoTime window in seconds to analyze logs (default: 300 = 5 minutes). Range: 30-300 seconds.

Output Schema

NameRequiredDescriptionDefault
errorNoError message if analysis failed
statusYesStatus of the analysis
resultsNoDetailed analysis results with occurrence statistics
source_idYesCluster ID or session ID
source_typeYesType of log source analyzed
issues_foundYesNumber of unique issues found
execution_time_msNoAnalysis execution time in milliseconds
total_occurrencesNoTotal number of issue occurrences across all logs

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/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 discloses the operational path (connect to S3 logs, run Athena queries, match against a curated issue knowledge base) and the output contents, which is more than most. It omits practically important traits: whether anything is mutated, that Athena queries incur cost and take time, and failure modes when logging is off.

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

Conciseness1/5

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

Front-loads the purpose well and uses headings, but the bulk is filler for a tool whose schema already documents everything: 'comprehensive knowledge base of curated EMR issues' restates what 'identify known issues' said, and the response-format list duplicates the output schema.

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?

Prerequisites and an output schema together cover the essentials for a three-parameter analytical tool. Gaps remain around cost/latency of Athena execution and the absence of any guidance distinguishing this tool from analyze_emr_logs.

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 coverage is 100%, so region, cluster_id and time_window are already documented including defaults and bounds. The description adds only a general framing ('connects to the cluster's logs') and no new semantics such as whether time_window scopes log selection or issue detection.

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?

States a specific verb and resource plus the mechanism ('Analyze EMR cluster logs using Amazon Athena') and what it produces (known-issue findings). It does not distinguish itself from the sibling analyze_emr_logs, so an agent cannot tell from the text alone which of the two to pick.

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?

Prerequisites (logging enabled to S3, AWS credentials for EMR/Athena/S3, Athena result location) imply when the tool will work, which is useful. However, there is no explicit when-to-use versus when-not guidance and no mention of the sibling tool as an alternative.

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

Deploy Server

Other Tools