Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
Native sampling method on Context #1128
Copy link
Copy link
Closed
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
Description
Metadata
Metadata
Assignees
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
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