-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
help wanted[Community] Extra attention is needed[Community] Extra attention is neededmcp[Component] Issues about MCP support[Component] Issues about MCP support
Milestone
Description
Describe the bug
When I add the sample to mcp, I can utilize it in other clients, but not in adk.
I get the error - ValueError: Client does not support sampling
To Reproduce
Steps to reproduce the behavior:
- Install - google-adk[a2a]==1.13.0, fastmcp==2.12.2,
- Run - create the mcp server as https://gofastmcp.com/servers/sampling
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'. Text to analyze: {text}""" # Request LLM analysis response = await ctx.sample(prompt) # Process the LLM's response sentiment = response.text.strip().lower() # Map to standard sentiment values if "positive" in sentiment: sentiment = "positive" elif "negative" in sentiment: sentiment = "negative" else: sentiment = "neutral" return {"text": text, "sentiment": sentiment}
- See error
Expected behavior
google adk should also support fastmcp native features.
Desktop (please complete the following information):
- OS: sles15
- Python version(python -V): 3.11.1
- ADK version(pip show google-adk): 1.13.0
Model Information:
openai/gpt4o, claude-sonnet-4
Additional context
Created discussion also, but no help.
#2892
Metadata
Metadata
Assignees
Labels
help wanted[Community] Extra attention is needed[Community] Extra attention is neededmcp[Component] Issues about MCP support[Component] Issues about MCP support