Description
Sampling is done by manually sending a SamplingMessage directly, the user has to do things like manage checking that the client supports sampling.
Compared to eliciation which has its own method directly on Context
result = await ctx.elicit(
I'd imagine that having a similar ctx.sampling method would be a bit more consistent. Even if just as a thin wrapper over sending a sampling message with a clear error if sampling isn't supported. Happy to take that on.
A related issue, which I can separate into its own issue if you'd like: With FastMCP, if I have a tool that requires sampling, I want it to now show up in ListTools for clients like Claude Desktop that don't support it.
References
No response
Description
Sampling is done by manually sending a SamplingMessage directly, the user has to do things like manage checking that the client supports sampling.
Compared to eliciation which has its own method directly on Context
result = await ctx.elicit(
I'd imagine that having a similar ctx.sampling method would be a bit more consistent. Even if just as a thin wrapper over sending a sampling message with a clear error if sampling isn't supported. Happy to take that on.
A related issue, which I can separate into its own issue if you'd like: With FastMCP, if I have a tool that requires sampling, I want it to now show up in ListTools for clients like Claude Desktop that don't support it.
References
No response