Skip to content

Conversation

@manusa
Copy link
Contributor

@manusa manusa commented Feb 18, 2025

Description

When the server interacts with a dynamic environment, it's useful to modify the tools list/handlers to adapt to the environment conditions as they change.

The current AddTool function is insufficient in case tools should no longer be available. In addition, for each AddTool invocation once the client is initialized, a new notifications/tools/list_changed is sent to the client. In case you need to change multiple tools at once, this might put pressure on the client.

This enhancement includes three new functions to handle this, plus refactors the tool management within the server:

  • AddTools: allows adding multiple tools at once.
  • SetTools: allows to completely replace the tools.
  • DeleteTools: allows deleting multiple tools at once.

Included tests to verify the described scenarios.

…ted methods

When the server interacts with a dynamic environment, it's useful to modify the
tools list/handlers to adapt to the environment conditions as they change.

The current `AddTool` function is insufficient in case tools should no longer be available.
In addition, for each `AddTool` invocation once the client is initialized,
a new `notifications/tools/list_changed` is sent to the client.
In case you need to change multiple tools at once, this might put pressure on the client.

This enhancement includes three new functions to handle this,
plus refactors the tool management within the server:
 - AddTools: allows adding multiple tools at once.
 - SetTools: allows to completely replace the tools.
 - DeleteTools: allows deleting multiple tools at once.
@ezynda3 ezynda3 merged commit c9443eb into mark3labs:main Feb 22, 2025
1 check passed
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