Skip to content

Is it possible to use both local tools and mcp server tools? #797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NCCYUNSONG opened this issue May 31, 2025 · 3 comments
Closed

Is it possible to use both local tools and mcp server tools? #797

NCCYUNSONG opened this issue May 31, 2025 · 3 comments
Labels
question Question about using the SDK

Comments

@NCCYUNSONG
Copy link

In my agent setting, I set both local tools and mcp server tools, and set model_settings=ModelSettings(
temperature=TEMPERATURE, tool_choice="required"), but the tracing showed only local tools were used. Is it possible to use both local tools and mcp server tools?

@NCCYUNSONG NCCYUNSONG added the question Question about using the SDK label May 31, 2025
@rm-openai
Copy link
Collaborator

Yes it is. tool_choice=required tells the model it must use some tool, but leaves the specific tool up to the model. You could add more stuff to your prompt to guide the model, or use an input that clearly requires the MCP tool.

Also note that the MCP server tool is called as part of the model, so it will show up in the call to responses API in the tracing UI. (i.e. the row that says POST/v1/responses)

@javon-yan
Copy link

You need to check whether the message sent when calling the LLM API includes all of your tools. If it does, then there's no issue. Which tool gets selected depends on your prompt and the LLM's decision-making, not on the Agent SDK itself.

@NCCYUNSONG
Copy link
Author

Thanks a lot. I found the reason. The prompt was not strong enough to make it use MCP tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about using the SDK
Projects
None yet
Development

No branches or pull requests

3 participants