feat: add workspace tools for list, get, and create operations#131
Merged
Conversation
mathislucka
added a commit
that referenced
this pull request
Jul 2, 2025
* feat: add workspace tools with list, get, and create functionality * feat: import workspace tools * feat: register workspace tools in tool registry * feat: add comprehensive unit tests for workspace tools * fix: types, format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds three new workspace tools to interact with the deepset workspace resource following the existing project patterns.
Changes Made
1. Created workspace tools (
src/deepset_mcp/tools/workspace.py)Added three new tool functions:
list_workspaces: Retrieves all workspaces available to the userget_workspace: Fetches detailed information for a specific workspace by namecreate_workspace: Creates a new workspace with the specified nameAll tools follow the established patterns:
2. Registered tools in tool factory (
src/deepset_mcp/tool_factory.py)TOOL_REGISTRYwithMemoryType.EXPLORABLEas requestedneeds_client=Truesince they don't require workspace parameters3. Added comprehensive unit tests (
test/unit/tools/test_workspace.py)Created a full test suite with:
FakeWorkspaceResource: Mock resource implementation for testingFakeClient: Test client that overrides theworkspaces()methodImplementation Details
The implementation leverages the existing workspace resource that was already available in the API SDK:
src/deepset_mcp/api/workspace/resource.pysrc/deepset_mcp/api/workspace/models.pyAll tools are registered with "explorable" memory type as requested, allowing their outputs to be stored and referenced by the memory system.
Testing
The test suite provides comprehensive coverage:
All tests follow the project's testing guidelines and use the existing
BaseFakeClientinfrastructure.Closes #130