Skip to content

Commit 09a520e

Browse files
authored
chore: export tools (#192)
1 parent 28abb6d commit 09a520e

2 files changed

Lines changed: 70 additions & 21 deletions

File tree

src/deepset_mcp/tools/__init__.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,60 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5+
from .custom_components import get_latest_custom_component_installation_logs, list_custom_component_installations
6+
from .doc_search import search_docs
7+
from .haystack_service import (
8+
get_component_definition,
9+
get_custom_components,
10+
list_component_families,
11+
run_component,
12+
search_component_definition,
13+
)
14+
from .indexes import create_index, deploy_index, get_index, list_indexes, update_index
15+
from .object_store import create_get_from_object_store, create_get_slice_from_object_store
16+
from .pipeline import (
17+
create_pipeline,
18+
deploy_pipeline,
19+
get_pipeline,
20+
get_pipeline_logs,
21+
list_pipelines,
22+
search_pipeline,
23+
update_pipeline,
24+
validate_pipeline,
25+
)
26+
from .pipeline_template import get_template, list_templates, search_templates
27+
from .secrets import get_secret, list_secrets
28+
from .workspace import get_workspace, list_workspaces
29+
30+
__all__ = [
31+
"list_custom_component_installations",
32+
"get_latest_custom_component_installation_logs",
33+
"search_docs",
34+
"run_component",
35+
"get_custom_components",
36+
"get_component_definition",
37+
"search_component_definition",
38+
"list_component_families",
39+
"list_indexes",
40+
"deploy_index",
41+
"update_index",
42+
"create_index",
43+
"get_index",
44+
"create_get_from_object_store",
45+
"create_get_slice_from_object_store",
46+
"list_pipelines",
47+
"get_pipeline",
48+
"get_pipeline_logs",
49+
"deploy_pipeline",
50+
"search_pipeline",
51+
"create_pipeline",
52+
"update_pipeline",
53+
"validate_pipeline",
54+
"list_templates",
55+
"get_template",
56+
"search_templates",
57+
"get_secret",
58+
"list_secrets",
59+
"list_workspaces",
60+
"get_workspace",
61+
]

src/deepset_mcp/tools/haystack_service.py

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@
2727
def extract_component_texts(*, component_def: dict[str, Any]) -> tuple[str, str]:
2828
"""Extracts the component name and description for embedding.
2929
30-
Args:
31-
component_def: The component definition
30+
:param component_def: The component definition
3231
33-
Returns:
34-
A tuple containing the component name and description
32+
:returns: A tuple containing the component name and description
3533
"""
3634
component_type = component_def["properties"]["type"]["const"]
3735
name = component_def.get("title", "")
@@ -170,13 +168,11 @@ async def _build_component_definition(
170168
async def get_component_definition(*, client: AsyncClientProtocol, component_type: str) -> ComponentDefinition | str:
171169
"""Returns the definition of a specific Haystack component.
172170
173-
Args:
174-
client: The API client to use
175-
component_type: Fully qualified component type
176-
(e.g. haystack.components.routers.conditional_router.ConditionalRouter)
171+
:param client: The API client to use
172+
:param component_type: Fully qualified component type
173+
(e.g. haystack.components.routers.conditional_router.ConditionalRouter)
177174
178-
Returns:
179-
ComponentDefinition model or error message string
175+
:returns: ComponentDefinition model or error message string
180176
"""
181177
haystack_service = client.haystack_service()
182178

@@ -207,14 +203,12 @@ async def search_component_definition(
207203
) -> ComponentSearchResults | str:
208204
"""Searches for components based on name or description using semantic similarity.
209205
210-
Args:
211-
client: The API client to use
212-
query: The search query
213-
model: The model to use for computing embeddings
214-
top_k: Maximum number of results to return (default: 5)
206+
:param client: The API client to use
207+
:param query: The search query
208+
:param model: The model to use for computing embeddings
209+
:param top_k: Maximum number of results to return (default: 5)
215210
216-
Returns:
217-
ComponentSearchResults model or error message string
211+
:returns: ComponentSearchResults model or error message string
218212
"""
219213
haystack_service = client.haystack_service()
220214

@@ -273,11 +267,9 @@ async def search_component_definition(
273267
async def list_component_families(*, client: AsyncClientProtocol) -> ComponentFamilyList | str:
274268
"""Lists all Haystack component families that are available on deepset.
275269
276-
Args:
277-
client: The API client to use
270+
:param client: The API client to use
278271
279-
Returns:
280-
ComponentFamilyList model or error message string
272+
:returns: ComponentFamilyList model or error message string
281273
"""
282274
haystack_service = client.haystack_service()
283275

0 commit comments

Comments
 (0)