# Away Goals Rule Evaluator AI Agent Connect

> Away Goals Rule Evaluator MCP handles the math for two-legged football ties. It calculates aggregate scores and applies away goals rules to determine if a team advances or if the match moves to extra time. Your AI client uses this to process scorelines and verify tie-breaker advantages instantly.

## Overview
- **Category:** utilities
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_Z7IsXkiTWbmnT6pItJFRaU7VO9XwmCKddtOl9v3e/ai-agent-connect
- **Tags:** football, soccer, scoring, tournament, tie-breaker

## Description

If you are managing tournament data or analyzing football results, calculating two-legged tie outcomes can get messy when away goals are involved. This MCP takes the guesswork out of aggregate scoring. You provide the scores from both legs, and your AI client handles the logic to see who moves on. It checks if the aggregate scores are level and then applies the away goals rule to find a winner. If the scores and away goals are both identical, it identifies that the tie must proceed to extra time. It works by validating your input data first to ensure the math stays accurate. You can quickly pull summaries of specific ties or verify exactly which team holds the advantage based on their away performance. It is a precise way to handle tournament progression logic without manual calculation errors.

## Tools

### check_away_goal_advantage
This tool checks if a team holds the advantage based on away goals. It compares away scoring across both legs to determine tie-breaker status.

### evaluate_tie
This tool determines the winner of a two-legged tie. It processes aggregate scores and applies the away goals rule to find the advancing team.

### get_tie_summary
This tool provides a breakdown of the tie. It returns the scorelines and aggregate totals for the competing teams.

### validate_scores
This tool ensures the provided score data is accurate and usable. It checks for data integrity before calculations begin.

## Prompt Examples

**Prompt:** 
```
Team A won 2-1 at home and lost 0-1 away. Team B won 1-0 at home and lost 1-2 away. The away-goals rule is enabled. Who won?
```

**Response:** 
```
Team A won with an aggregate score of 2-2 and 1 away goal compared to Team B's 0 away goals.
```

**Prompt:** 
```
Calculate the tie result for Team A (Home: 1, Away: 1) and Team B (Home: 1, Away: 1) with the away-goals rule enabled.
```

**Response:** 
```
The tie moves to the next stage because aggregate scores and away goals are identical.
```

**Prompt:** 
```
Get a summary for Team A (Home: 3, Away: 0) and Team B (Home: 0, Away: 3) with the away-goals rule enabled.
```

**Response:** 
```
The aggregate score is 3-3, and the away-goals rule was applied to determine the winner.
```

## Capabilities

### Aggregate Scoring
Your agent calculates the total goals scored across both legs of a tie.

### Away Goal Application
The AI applies the away goals rule to break ties when aggregate scores are equal.

### Tie Progression Logic
Your client identifies when a match must proceed to extra time or a penalty shootout.

### Score Validation
The MCP checks that the input scores are valid before running any calculations.

### Tie Summarization
Your agent generates a clear summary of the scorelines and the final outcome.

## Use Cases

### Tournament Management
Automate the advancement of teams in knockout stages based on two-legged results.

### Data Verification
Check that tournament results were calculated correctly according to official rules.

### Real-time Match Analysis
Determine the winner of a tie immediately after the second leg concludes.

### Statistical Reporting
Generate summaries of aggregate scores and away goal advantages for match reports.

## Benefits

- Eliminates manual math errors in aggregate score calculations.
- Automates the application of the away goals rule.
- Provides instant tie-breaker status for two-legged matches.
- Validates score data to ensure calculation accuracy.

## How It Works

Connecting to this MCP gives your AI client the ability to process football tie-breaker logic.

1. Connect your preferred MCP client to Vinkius.
2. Provide the match scores for both legs to your AI agent.
3. The agent uses the MCP tools to validate and calculate the scores.
4. The AI returns the winner or identifies if the tie moves to extra time.

## Frequently Asked Questions

**What does this MCP do?**
It calculates the winners of two-legged football ties by using aggregate scores and the away goals rule.

**Can it handle ties that go to extra time?**
Yes. If aggregate scores and away goals are identical, the tool identifies that the tie must proceed to the next stage.

**Which AI clients can use this?**
You can use this with any MCP-compatible client like Claude, Cursor, or Windsurf.

**Does it work for all football formats?**
It is specifically designed for two-legged ties where aggregate scores and away goals are the primary tie-breakers.

**How do I ensure my scores are correct?**
The MCP includes a validation tool to check the integrity of your score data before it performs calculations.

**How does the away-goals rule work in this tool?**
When aggregate scores are tied and the rule is enabled, the team with more away goals is declared the winner via `evaluate_tie`.

**Can I validate if my input scores are valid?**
Yes, you can use the `validate_scores` tool to ensure all goal counts are non-negative integers.

**What happens if the away-goals rule is disabled?**
If the rule is disabled and aggregate scores are tied, the tie will proceed to the next stage.
