From 4258a3a078e50a00dbaec778e0860e0415193386 Mon Sep 17 00:00:00 2001 From: tholor Date: Wed, 29 Apr 2026 14:43:15 +0200 Subject: [PATCH] fix: create_pipeline tool kwarg mismatch with PipelineResource The create_pipeline tool called PipelineResource.create(name=...) but the implementation expects pipeline_name=..., causing the tool to fail with "got an unexpected keyword argument 'name'". The protocol declared the parameter as `name` while the implementation used `pipeline_name`, so tests against mocks passed but real calls failed. Aligned the protocol, mocks, and caller on `pipeline_name` to match the implementation and the rest of the pipeline resource API. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/deepset_mcp/api/pipeline/protocols.py | 2 +- src/deepset_mcp/tools/pipeline.py | 2 +- test/unit/tools/test_doc_search.py | 2 +- test/unit/tools/test_pipeline.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/deepset_mcp/api/pipeline/protocols.py b/src/deepset_mcp/api/pipeline/protocols.py index 34016d0..09e8fe4 100644 --- a/src/deepset_mcp/api/pipeline/protocols.py +++ b/src/deepset_mcp/api/pipeline/protocols.py @@ -32,7 +32,7 @@ async def list(self, limit: int = 10, after: str | None = None) -> PaginatedResp """List pipelines in the configured workspace with optional pagination.""" ... - async def create(self, name: str, yaml_config: str) -> NoContentResponse: + async def create(self, pipeline_name: str, yaml_config: str) -> NoContentResponse: """Create a new pipeline with a name and YAML config.""" ... diff --git a/src/deepset_mcp/tools/pipeline.py b/src/deepset_mcp/tools/pipeline.py index d60b790..d6a8243 100644 --- a/src/deepset_mcp/tools/pipeline.py +++ b/src/deepset_mcp/tools/pipeline.py @@ -128,7 +128,7 @@ async def create_pipeline( error_messages = [f"{error.code}: {error.message}" for error in validation_response.errors] return "Pipeline validation failed:\n" + "\n".join(error_messages) - await client.pipelines(workspace=workspace).create(name=pipeline_name, yaml_config=yaml_configuration) + await client.pipelines(workspace=workspace).create(pipeline_name=pipeline_name, yaml_config=yaml_configuration) # Get the full pipeline after creation pipeline = await client.pipelines(workspace=workspace).get(pipeline_name) diff --git a/test/unit/tools/test_doc_search.py b/test/unit/tools/test_doc_search.py index 1b4ed85..8f8843e 100644 --- a/test/unit/tools/test_doc_search.py +++ b/test/unit/tools/test_doc_search.py @@ -77,7 +77,7 @@ async def list( ) -> PaginatedResponse[DeepsetPipeline]: raise NotImplementedError - async def create(self, name: str, yaml_config: str) -> NoContentResponse: + async def create(self, pipeline_name: str, yaml_config: str) -> NoContentResponse: raise NotImplementedError async def list_versions( diff --git a/test/unit/tools/test_pipeline.py b/test/unit/tools/test_pipeline.py index 6a864d2..8933779 100644 --- a/test/unit/tools/test_pipeline.py +++ b/test/unit/tools/test_pipeline.py @@ -139,7 +139,7 @@ async def validate(self, yaml_config: str) -> PipelineValidationResult: return self._validate_response raise NotImplementedError - async def create(self, name: str, yaml_config: str) -> NoContentResponse: + async def create(self, pipeline_name: str, yaml_config: str) -> NoContentResponse: if self._create_exception: raise self._create_exception if self._create_response is not None: