Repository navigation
Replies: 2 comments
0 replies
|
@shivsant lizzij's suggestion above (giving the FastMCP server its own sampling handler) is one way around it but worth knowing ADK also added proper support for this since. McpToolset now takes a sampling_callback so your agent's own LLM can answer the server's ctx.sample() calls directly, no server-side handler needed. Closing this out since it looks addressed, feel free to reopen or comment if you're still running into it. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
fastmcp supports sample, but when I use adk, it says ValueError: Client does not support sampling
This is an example of how to use sampleing in fastmcp.
from fastmcp import FastMCP, Context
mcp = FastMCP("SamplingDemo")
@mcp.tool
async def analyze_sentiment(text: str, ctx: Context) -> dict:
"""Analyze the sentiment of text using the client's LLM."""
prompt = f"""Analyze the sentiment of the following text as positive, negative, or neutral.
Just output a single word - 'positive', 'negative', or 'neutral'.
All reactions