Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@joejoe2
Copy link
Contributor

@joejoe2 joejoe2 commented May 10, 2025

refer to #33

  • make atool async
  • add sync start() method
  • add refresh tools logic

joejoe2 added 2 commits May 10, 2025 11:16
- make atool async
- add sync start() method
- add refresh tools logic
@grll
Copy link
Owner

grll commented May 12, 2025

hey @joejoe2 thanks a lot for the work and pushing for this I think this is a great change. Could we add 2 tests for the sync and async mode where the tools would change between the two calls on the server with a dummy adapter?

@joejoe2
Copy link
Contributor Author

joejoe2 commented May 13, 2025

hey @joejoe2 thanks a lot for the work and pushing for this I think this is a great change. Could we add 2 tests for the sync and async mode where the tools would change between the two calls on the server with a dummy adapter?

ok, I will add them

@joejoe2
Copy link
Contributor Author

joejoe2 commented May 13, 2025

@grll Plz check again, thanks !

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for the tests I think it's exactly what we need, I am just a bit sad about the fact that we need to wait 10seconds for it. Do you think we could call the update_tool function / mcp.add_tool() in the test and reduce as much as possible the wait time? something in the test like:


# 1. assert initial tools
# 2. run mcp.add_tool
# 3. (here I am afraid we might have to wait a bit unless we could block the program until the add_tool is done?)
# 4. assert initial tools + new tools

What do you think?

Copy link
Contributor Author

@joejoe2 joejoe2 May 13, 2025

Choose a reason for hiding this comment

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

Seems like the server script is run in another process by uv. Any idea to achieve this ? I cannot come up an easy way.

Copy link
Contributor Author

@joejoe2 joejoe2 May 14, 2025

Choose a reason for hiding this comment

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

Maybe just move mcp.add_tool() into the initial tool. Also the add_tool() will not take effect for exsisting tool.

Copy link
Owner

Choose a reason for hiding this comment

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

I think the simplest to achieve this would be to create a tool on the server "add_tool" which effectively adds a new tool to the MCP server that way we could call that tool in the test to add the tool on the MCP. I think it could work no?

@joejoe2
Copy link
Contributor Author

joejoe2 commented May 14, 2025

Prevent sleep in test works !

Copy link
Owner

@grll grll left a comment

Choose a reason for hiding this comment

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

great thanks!

@grll grll merged commit 3e1c7c0 into grll:main May 15, 2025
3 checks passed
amithkk pushed a commit to amithkk/mcpadapt that referenced this pull request Sep 6, 2025
* always get latest tools

- make atool async
- add sync start() method
- add refresh tools logic

* remove unused import

* add tests for refresh tools in sync/async ctx

* prevent sleep in tests
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.

2 participants