# Sudoku Grid Validator AI Agent Connect

> A deterministic engine for validating 9x9 Sudoku grid states and identifying rule violations.

## Overview
- **Category:** utilities
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_nwFgDDbBmN2X5Kdc8nptHNbeiALAm5TvlfOAbJCI/ai-agent-connect
- **Tags:** sudoku, validation, logic-puzzle, grid, math

## Description

This MCP server provides a deterministic engine to validate 9x9 Sudoku grids. It can check if a partial grid state is valid by identifying duplicate numbers in rows, columns, or 3x3 boxes, or determine if a fully filled grid is a solved puzzle. Use `validate_grid_state` to find specific rule violations like duplicate numbers, `check_completeness` to see if any cells are still empty, or `get_box_coordinates` to retrieve the cell indices for a specific 3x3 sub-grid.

## Tools

### check_completeness
Quickly determines if the puzzle is ready to be evaluated as a finished solution

### get_box_coordinates
Maps a box index to its constituent cell coordinates for localized validation

### validate_grid_state
Checks if the current grid state adheres to Sudoku rules and identifies specific conflicts

## Prompt Examples

**Prompt:** 
```
Is this Sudoku grid valid: [[5,3,0,0,7,0,0,0,0],[6,0,0,1,9,5,0,0,0],[0,9,8,0,0,0,0,6,0],[8,0,0,0,6,0,0,0,3],[4,0,0,8,0,3,0,0,1],[7,0,0,0,2,0,0,0,6],[0,6,0,0,0,0,2,8,0],[0,0,0,4,1,9,0,0,5],[0,0,0,0,8,0,0,7,9]]?
```

**Response:** 
```
The current grid state is valid, but it is not solved because there are empty cells.
```

**Prompt:** 
```
Check if this grid has any duplicates: [[5,5,0,0,7,0,0,0,0],[6,0,0,1,9,5,0,0,0],[0,9,8,0,0,0,0,6,0],[8,0,0,0,6,0,0,0,3],[4,0,0,8,0,3,0,0,1],[7,0,0,0,2,0,0,0,6],[0,6,0,0,0,0,2,8,0],[0,0,0,4,1,9,0,0,5],[0,0,0,0,8,0,0,7,9]]
```

**Response:** 
```
The grid is invalid. Row 0 has duplicate 5.
```

**Prompt:** 
```
How many empty cells are in this grid: [[1,2,3,4,5,6,7,8,9],[4,5,6,7,8,9,1,2,3],[7,8,9,1,2,3,4,5,6],[2,3,1,5,6,4,8,9,7],[5,6,4,8,9,7,2,3,1],[8,9,7,2,3,1,5,6,4],[3,1,2,6,4,5,9,7,8],[6,4,5,9,7,8,3,1,2],[9,7,8,3,1,2,6,4,5]]?
```

**Response:** 
```
The grid is fully filled with 0 empty cells.
```

## Frequently Asked Questions

**How do I check if my Sudoku grid is valid?**
You can use the `validate_grid_state` tool by providing the 9x9 grid as a JSON string. It will return whether the state is valid and list any specific violations found.

**Can this tool tell me if a Sudoku is fully solved?**
Yes, the `validate_grid_state` tool returns an `isSolved` boolean which is true only if the grid is valid and contains no empty cells (zeros).

**How can I find the coordinates for a specific 3x3 box?**
Use the `get_box_coordinates` tool and provide the box index from 0 to 8 to get the row and column indices for that sub-grid.
