Skip to content

fix: use underscore naming for Tavily tool functions in DeepResearch agent#1400

Open
octo-patch wants to merge 2 commits intoagentscope-ai:mainfrom
octo-patch:fix/issue-1391-tavily-tool-names
Open

fix: use underscore naming for Tavily tool functions in DeepResearch agent#1400
octo-patch wants to merge 2 commits intoagentscope-ai:mainfrom
octo-patch:fix/issue-1391-tavily-tool-names

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #1391

Problem

The DeepResearch agent used hyphenated tool names (tavily-search, tavily-extract) but the MCP server registers tools with underscore names (tavily_search, tavily_extract). This mismatch caused:

  • Follow-up extraction to never trigger (name-based branch logic failed)
  • Agent repeatedly calling tavily_search for already-covered information

Solution

Update self.search_function and self.extract_function to use underscore naming (tavily_search, tavily_extract) to match the names registered by the MCP server.

Testing

Run examples/agent/deep_research_agent/main.py with a query that requires search + extract. The agent should now correctly recognize tool names, trigger follow-up extraction when needed, and avoid redundant repeated searches.

fixes agentscope-ai#1392)

The mcp python-sdk renamed `streamablehttp_client` to `streamable_http_client`
in the streamable_http transport module. Update both the stateful and stateless
HTTP MCP clients to use the new function name.
…agent (fixes agentscope-ai#1391)

MCP registers tools with underscore names (tavily_search, tavily_extract) but
the DeepResearch agent used hyphenated names (tavily-search, tavily-extract).
This mismatch caused the follow-up extraction to never trigger and led to
repeated redundant searches.
@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Apr 2, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Luohh5
Copy link
Copy Markdown
Member

Luohh5 commented Apr 3, 2026

@qbc2016 This PR fix the issue #1391. The changes in deep research agent looks good to me. Please check the changes in mcp files.

Copy link
Copy Markdown
Member

@qbc2016 qbc2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! I noticed this PR contains changes for two different features. To make the review and merge process smoother, could you please split them into separate PRs? This helps us track and review each feature independently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:Wrong use of Tavily tool in DeepResearch example

3 participants