You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: REPO.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Haystack is an Open Source Python framework for AI application building.
10
10
All source code is in `src/deepset_mcp`.
11
11
Code for the API SDK is in `src/deepset_mcp/api`.
12
12
Code for tools is in `src/deepset_mcp/tools`.
13
-
The tools are added to an MCP server which is defined in main.py
13
+
The tools are added to an MCP server which is defined in `src/deepset_mcp/main.py` and configured in `src/deepset_mcp/tool_factory.py`.
14
14
15
15
Tests are in the `test` directory.
16
16
All unit tests go into `test/unit`, integration tests go into `test/integration`.
@@ -36,11 +36,11 @@ async with AsyncDeepsetClient() as client:
36
36
37
37
### Tool Structure
38
38
39
-
Tools are meant to be used by large language models. Therefore, the output of a tool should always be a string.
40
-
Known exceptions should usually be caught and converted to strings as well.
39
+
Tools are meant to be used by large language models.
40
+
Known exceptions should usually be caught and converted to strings.
41
41
Typically, we have one tool file per resource.
42
42
A tool can make multiple calls to different resources or different methods on the same resource to produce the desired output.
43
-
Most tools are imported into `src/deepset_mcp/main.py` where they are added to the MCP server.
43
+
Most tools are imported into `src/deepset_mcp/tool_factory.py` where they are added to the MCP server.
44
44
45
45
46
46
## Instructions for common tasks
@@ -53,8 +53,8 @@ You would need to make the following changes:
53
53
1. add a package for the resource at `src/deepset_mcp/api/pipeline_feedback`
54
54
2. the resource goes into `src/deepset_mcp/api/pipeline_feedback/resource.py`
55
55
3. (optional) if you need to define models for API response they would go into `src/deepset_mcp/api/pipeline_feedback/models.py`
56
-
4. add a Protocol for the resource in `src/deepset_mcp/api/protocols.py`
57
-
5. add the resource to the AsyncClientProtocol in the same file (depending on the resource you need client and workspace or just client)
56
+
4. add a Protocol for the resource in `src/deepset_mcp/api/pipeline_feedback/protocols.py`
57
+
5. add the resource to the AsyncClientProtocol in the `src/deepset_mcp/api/protocols.py` (depending on the resource you need client and workspace or just client)
58
58
6. add a method for the resource to the `AsyncDeepsetClient` in `src/deepset_mcp/api/client.py`
59
59
60
60
#### Testing the resource
@@ -85,9 +85,8 @@ You would need to perform the following steps:
85
85
3. the tool should call the methods on the resource through the client
86
86
4. refer to `src/deepset_mcp/tools/pipeline.py` as a good example for tool implementations
87
87
5. extract model or response serialization into reusable helper functions
88
-
6. once you added a tool, import it in `src/deepset_mcp/main.py`
89
-
7. add a corresponding mcp tool using the `@mcp.tool`-decorator
90
-
8. the docstring of the tool will serve as the prompt for the large language model calling the tool, make sure it has good instructions on when to use the tool, how to best use it, and what kind of answer to expect.
88
+
6. once you added a tool, import it in `src/deepset_mcp/tool_factory.py` and add it to the tool registry with the appropriate config
89
+
7the docstring of the tool will serve as the prompt for the large language model calling the tool, make sure it has good instructions on when to use the tool, how to best use it, and what kind of answer to expect.
0 commit comments