get_wordle_solution
Retrieve the Wordle solution for any date from May 19, 2021 to 23 days in the future. Access historical and upcoming daily word answers by specifying your target date.
Instructions
Fetches the Wordle of a particular date provided between 2021-05-19 to 23 days future
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_date | No | 2026-04-05 |
Implementation Reference
- src/mcp_wordle/main.py:38-67 (handler)The main handler function get_wordle_data that executes the tool logic. It makes an HTTP GET request to the NYT Wordle API for the specified date and returns the JSON response containing the Wordle solution.
async def get_wordle_data( target_date: str = date.today().isoformat(), ) -> Union[WordleAPIData, WordleError]: """ Retrieves Wordle puzzle data for a specified date. This function fetches the complete Wordle solution and associated metadata for any given date within the supported range. You may provide the word, as well as the definition too, if needed. Args: date (str, optional): Target date in YYYY-MM-DD format. If not provided, defaults to the current date. Returns: dict: JSON response containing: - solution: The 5-letter Wordle answer - puzzle_id: Sequential puzzle number - metadata: Additional puzzle information (editor, days since launch, etc.) Note: - Date format must be YYYY-MM-DD (ISO 8601) - Available date range: 2021-05-19 (Wordle launch) to 23 days future - Returns error for dates outside supported range """ url: str = f"https://www.nytimes.com/svc/wordle/v2/{target_date}.json" # Make the GET request to the Wordle API return requests.get(url, timeout=300).json() - src/mcp_wordle/main.py:30-37 (registration)The tool registration using @mcp.tool() decorator. Registers the tool with name='get_wordle_solution', description about the date range, and readOnlyHint annotation.
@mcp.tool( name="get_wordle_solution", description=( "Fetches the Wordle of a particular date provided " "between 2021-05-19 to 23 days future" ), annotations={"readOnlyHint": True}, ) - src/mcp_wordle/main.py:16-27 (schema)Type definitions for the tool's input/output. WordleAPIData defines the successful response structure with solution, id, print_date, days_since_launch, and editor fields. WordleError defines the error response structure.
class WordleAPIData(TypedDict): id: int solution: str print_date: str days_since_launch: int editor: str class WordleError(TypedDict): status: str errors: list[str] results: list