Skip to content

Commit 765f63f

Browse files
authored
chore: update REPO.md for agent (#127)
1 parent 98ba1b0 commit 765f63f

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

REPO.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Haystack is an Open Source Python framework for AI application building.
1010
All source code is in `src/deepset_mcp`.
1111
Code for the API SDK is in `src/deepset_mcp/api`.
1212
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`.
1414

1515
Tests are in the `test` directory.
1616
All unit tests go into `test/unit`, integration tests go into `test/integration`.
@@ -36,11 +36,11 @@ async with AsyncDeepsetClient() as client:
3636

3737
### Tool Structure
3838

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.
4141
Typically, we have one tool file per resource.
4242
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.
4444

4545

4646
## Instructions for common tasks
@@ -53,8 +53,8 @@ You would need to make the following changes:
5353
1. add a package for the resource at `src/deepset_mcp/api/pipeline_feedback`
5454
2. the resource goes into `src/deepset_mcp/api/pipeline_feedback/resource.py`
5555
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)
5858
6. add a method for the resource to the `AsyncDeepsetClient` in `src/deepset_mcp/api/client.py`
5959

6060
#### Testing the resource
@@ -85,9 +85,8 @@ You would need to perform the following steps:
8585
3. the tool should call the methods on the resource through the client
8686
4. refer to `src/deepset_mcp/tools/pipeline.py` as a good example for tool implementations
8787
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.
9190

9291
#### Testing the tool
9392

0 commit comments

Comments
 (0)