Skip to content

Commit 85550bc

Browse files
committed
Improve project metadata and refactor source layout
- Updated project description and author details in pyproject.toml - Moved `main.py` to `src/mcp_wordle/main.py` - Added module docstring with author and timestamp - Enhanced `FastMCP` initialization with dependencies - Added error type `WordleError` to API function signature - Improved function docstring for clarity
1 parent 9f1de7c commit 85550bc

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
[project]
22
name = "mcp-wordle"
33
version = "0.1.0"
4-
description = "Add your description here"
4+
description = "MCP Server that returns Wordle solutions for a particular date"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
88
"fastmcp>=2.9.2",
99
"requests>=2.32.4",
1010
]
11+
12+
[[project.authors]]
13+
name = "Chandrashekhar R"
14+
email = "73425927+cr2007@users.noreply.github.com"

main.py renamed to src/mcp_wordle/main.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
"""
2+
Created on 2025-06-27 23:15:13 Thursday
3+
4+
@author: Chandrashekhar R
5+
"""
6+
17
from datetime import date
28
from typing import TypedDict
39

410
import requests
511
from fastmcp import FastMCP
612

7-
mcp = FastMCP("WordleMCP")
13+
mcp = FastMCP("WordleMCP", dependencies=["requests"])
814

915
class WordleAPIData(TypedDict):
1016
id: int
@@ -13,18 +19,24 @@ class WordleAPIData(TypedDict):
1319
days_since_launch: int
1420
editor: str
1521

22+
class WordleError(TypedDict):
23+
status: str
24+
errors: list[str]
25+
results: list
26+
1627

1728
@mcp.tool(
1829
name="get_wordle_solution",
1930
description="Fetches the Wordle of a particular date provided between 2021-05-19 to 23 days future",
2031
annotations={"readOnlyHint": True}
2132
)
22-
async def get_wordle_data(date: str = date.today().isoformat()) -> WordleAPIData:
33+
async def get_wordle_data(date: str = date.today().isoformat()) -> WordleAPIData | WordleError:
2334
"""
2435
Retrieves Wordle puzzle data for a specified date.
2536
2637
This function fetches the complete Wordle solution and associated metadata
27-
for any given date within the supported range.
38+
for any given date within the supported range. You may provide the word, as well as
39+
the definition too, if needed.
2840
2941
Args:
3042
date (str, optional): Target date in YYYY-MM-DD format. If not provided,

0 commit comments

Comments
 (0)