Skip to content

Commit 81270ae

Browse files
committed
Update tool descriptions
1 parent ae431e4 commit 81270ae

3 files changed

Lines changed: 84 additions & 32 deletions

File tree

main.py

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def deepset_api_request(endpoint: str, method: str = "GET", data: Optional[Dict]
6868

6969
@mcp.tool()
7070
def list_pipelines() -> Dict[str, Any]:
71-
"""Lists all pipelines in the configured deepset Cloud workspace"""
71+
"""Retrieves a list of all pipelines available within the currently configured deepset workspace. Use this when you need to know the names or IDs of existing pipelines."""
7272
workspace = get_workspace()
7373
try:
7474
return deepset_api_request(f"/workspaces/{workspace}/pipelines")
@@ -77,7 +77,7 @@ def list_pipelines() -> Dict[str, Any]:
7777

7878
@mcp.tool()
7979
def get_pipeline(pipeline_id: str) -> Dict[str, Any]:
80-
"""Gets details for a specific pipeline by ID"""
80+
"""Fetches detailed configuration information for a specific pipeline, identified by its unique `pipeline_id`. This includes its components, connections, and metadata. Use this when you need to inspect the structure or settings of a known pipeline."""
8181
workspace = get_workspace()
8282
try:
8383
return deepset_api_request(f"/workspaces/{workspace}/pipelines/{pipeline_id}")
@@ -86,10 +86,7 @@ def get_pipeline(pipeline_id: str) -> Dict[str, Any]:
8686

8787
@mcp.tool()
8888
def get_component_schemas() -> Dict[str, Any]:
89-
"""
90-
Fetches all available Haystack component schemas showing their input/output types
91-
from the deepset Cloud API
92-
"""
89+
"""Retrieves the schemas for all available Haystack components from the deepset API. These schemas define the expected input and output parameters for each component type, which is useful for constructing or validating componets in a pipeline YAML."""
9390
try:
9491
return deepset_api_request("/haystack/components/input-output")
9592
except Exception as e:
@@ -98,13 +95,7 @@ def get_component_schemas() -> Dict[str, Any]:
9895
@mcp.tool()
9996
def validate_pipeline_yaml(yaml_content: str) -> Dict[str, Any]:
10097
"""
101-
Validates a pipeline YAML definition against the deepset Cloud API
102-
103-
Args:
104-
yaml_content: The YAML content to validate
105-
106-
Returns:
107-
Validation results including any errors or warnings
98+
Validates the structure and syntax of a provided pipeline YAML configuration against the deepset API specifications. Provide the YAML content as a string. Returns a validation result, indicating success or detailing any errors or warnings found. Use this *before* attempting to create or update a pipeline with new YAML.
10899
"""
109100
# Basic validation of the input
110101
if not yaml_content or not yaml_content.strip():
@@ -139,13 +130,7 @@ def validate_pipeline_yaml(yaml_content: str) -> Dict[str, Any]:
139130
@mcp.tool()
140131
def get_pipeline_yaml(pipeline_name: str) -> str:
141132
"""
142-
Fetches the YAML definition of a specific pipeline
143-
144-
Args:
145-
pipeline_name: The name of the pipeline to retrieve the YAML for
146-
147-
Returns:
148-
The pipeline YAML definition as a string
133+
Retrieves the complete YAML configuration file for a specific pipeline, identified by its `pipeline_name`. Returns the YAML content as a string. Use this when you need the exact YAML definition of an existing pipeline, for example, to inspect it or use it as a base for modifications.
149134
"""
150135
workspace = get_workspace()
151136
try:
@@ -161,14 +146,7 @@ def get_pipeline_yaml(pipeline_name: str) -> str:
161146
@mcp.tool()
162147
def update_pipeline_yaml(pipeline_name: str, yaml_content: str) -> Dict[str, Any]:
163148
"""
164-
Updates the YAML definition of a specific pipeline.
165-
166-
Args:
167-
pipeline_name: The name of the pipeline to update.
168-
yaml_content: The new YAML content for the pipeline.
169-
170-
Returns:
171-
API response indicating success or failure.
149+
Updates an existing pipeline in deepset, identified by `pipeline_name`, with a new YAML configuration provided as `yaml_content`. This will replace the entire existing configuration of the pipeline. Use this carefully, preferably after validating the new YAML content.
172150
"""
173151
# Basic validation
174152
if not yaml_content or not yaml_content.strip():
@@ -241,4 +219,5 @@ def get_pipeline_yaml_resource(pipeline_name: str) -> str:
241219

242220
if __name__ == "__main__":
243221
# Using the built-in server runner
244-
mcp.run()
222+
# Ensure it binds to 0.0.0.0 to be accessible in Docker
223+
mcp.run(host="0.0.0.0", port=8000)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ readme = "README.md"
66
requires-python = ">=3.11"
77
dependencies = [
88
"fastapi>=0.115.12",
9-
"mcp>=1.6.0",
9+
"mcp[cli]>=1.6.0",
1010
"requests>=2.32.3",
1111
"uvicorn>=0.34.2",
1212
]

uv.lock

Lines changed: 75 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)