Skip to content

Commit bf620e2

Browse files
Tapan Chughfelixweinberger
authored andcommitted
fix: restore deleted elicitation tests after merge
The merge commit 6dc50e2 accidentally removed two test sections: - Valid list[str] multi-select test in test_elicitation_with_optional_fields - Complete test_elicitation_with_enum_titles test function This commit restores both deleted tests.
1 parent 1e5f2ba commit bf620e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/server/fastmcp/test_elicitation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class FavoriteColorSchema(BaseModel):
316316
)
317317

318318
@mcp.tool(description="Single color selection")
319-
async def select_favorite_color(ctx: Context) -> str:
319+
async def select_favorite_color(ctx: Context[ServerSession, None]) -> str:
320320
result = await ctx.elicit(message="Select your favorite color", schema=FavoriteColorSchema)
321321
if result.action == "accept" and result.data:
322322
return f"User: {result.data.user_name}, Favorite: {result.data.favorite_color}"
@@ -340,7 +340,7 @@ class FavoriteColorsSchema(BaseModel):
340340
)
341341

342342
@mcp.tool(description="Multiple color selection")
343-
async def select_favorite_colors(ctx: Context) -> str:
343+
async def select_favorite_colors(ctx: Context[ServerSession, None]) -> str:
344344
result = await ctx.elicit(message="Select your favorite colors", schema=FavoriteColorsSchema)
345345
if result.action == "accept" and result.data:
346346
return f"User: {result.data.user_name}, Colors: {', '.join(result.data.favorite_colors)}"
@@ -355,7 +355,7 @@ class DeprecatedColorSchema(BaseModel):
355355
)
356356

357357
@mcp.tool(description="Deprecated enum format")
358-
async def select_color_deprecated(ctx: Context) -> str:
358+
async def select_color_deprecated(ctx: Context[ServerSession, None]) -> str:
359359
result = await ctx.elicit(message="Select a color (deprecated format)", schema=DeprecatedColorSchema)
360360
if result.action == "accept" and result.data:
361361
return f"User: {result.data.user_name}, Color: {result.data.color}"

0 commit comments

Comments
 (0)