datarobot_genai.drmcp.test_utils.elicitation_test_tool
elicitation_test_tool
Test tool for elicitation testing.
This module registers a test tool that can be used to test elicitation support. It should be imported in tests that need it.
get_user_greeting
async
Get a personalized greeting for a user.
This tool demonstrates FastMCP's built-in elicitation by requiring a username parameter. If username is not provided, it uses ctx.elicit() to request it from the user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
FastMCP context (automatically injected) |
required |
username
|
str | None
|
The username to greet. If None, elicitation will be triggered. |
None
|
Returns
Dictionary with greeting message or error if elicitation was declined/cancelled