Skip to content

Commit fe0bcd6

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 c8e0c38 commit fe0bcd6

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
@@ -310,7 +310,7 @@ class FavoriteColorSchema(BaseModel):
310310
)
311311

312312
@mcp.tool(description="Single color selection")
313-
async def select_favorite_color(ctx: Context) -> str:
313+
async def select_favorite_color(ctx: Context[ServerSession, None]) -> str:
314314
result = await ctx.elicit(message="Select your favorite color", schema=FavoriteColorSchema)
315315
if result.action == "accept" and result.data:
316316
return f"User: {result.data.user_name}, Favorite: {result.data.favorite_color}"
@@ -334,7 +334,7 @@ class FavoriteColorsSchema(BaseModel):
334334
)
335335

336336
@mcp.tool(description="Multiple color selection")
337-
async def select_favorite_colors(ctx: Context) -> str:
337+
async def select_favorite_colors(ctx: Context[ServerSession, None]) -> str:
338338
result = await ctx.elicit(message="Select your favorite colors", schema=FavoriteColorsSchema)
339339
if result.action == "accept" and result.data:
340340
return f"User: {result.data.user_name}, Colors: {', '.join(result.data.favorite_colors)}"
@@ -349,7 +349,7 @@ class DeprecatedColorSchema(BaseModel):
349349
)
350350

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

0 commit comments

Comments
 (0)