Skip to content

Commit 25138fe

Browse files
committed
Bug fix
1 parent 696510c commit 25138fe

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [ "hatchling" ]
44

55
[project]
66
name = "protocol-mcp"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
description = "MCP that connects to wetlab protocol resources, including protocols.io"
99
readme = "README.md"
1010
license = { file = "LICENSE" }

server.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "protocol-mcp",
33
"description": "MCP server that connects to wetlab protocol resources, including protocols.io",
4-
"version": "0.1.0",
4+
"version": "0.1.1",
55
"repository": "https://github.com/biocontext-ai/protocol-mcp",
66
"tools": [
77
{
@@ -67,8 +67,8 @@
6767
]
6868
},
6969
"installation": {
70-
"uv": "uvx protocol-mcp",
71-
"pip": "pip install protocol-mcp"
70+
"uv": "uvx protocol_mcp",
71+
"pip": "pip install protocol_mcp"
7272
},
7373
"run": {
7474
"command": "protocol_mcp",

src/protocol_mcp/clients/protocols_io.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ async def search_protocols(
8383
query: str,
8484
page_size: int = 10,
8585
page_id: int = 1,
86-
filter_params: dict[str, Any] | None = None,
86+
filter_type: str = "public",
87+
order_field: str = "date",
88+
order_dir: str = "desc",
8789
) -> dict[str, Any]:
8890
"""Search for protocols using v3 API.
8991
@@ -92,11 +94,17 @@ async def search_protocols(
9294
query : str
9395
Search query string.
9496
page_size : int
95-
Number of results per page.
97+
Number of results per page (1-100).
9698
page_id : int
9799
Page number (1-indexed).
98-
filter_params : dict[str, Any] | None
99-
Additional filter parameters.
100+
filter_type : str
101+
Protocol filter type. One of: 'public', 'user_public',
102+
'user_private', 'shared_with_user'. Defaults to 'public'.
103+
order_field : str
104+
Sort field: 'activity', 'date', 'name', or 'id'.
105+
Defaults to 'date'.
106+
order_dir : str
107+
Sort direction: 'asc' or 'desc'. Defaults to 'desc'.
100108
101109
Returns
102110
-------
@@ -105,13 +113,13 @@ async def search_protocols(
105113
"""
106114
url = f"{self.config.base_url_v3}/protocols"
107115
params = {
116+
"filter": filter_type,
108117
"key": query,
109118
"page_size": page_size,
110119
"page_id": page_id,
111-
"order_field": "relevance",
120+
"order_field": order_field,
121+
"order_dir": order_dir,
112122
}
113-
if filter_params:
114-
params.update(filter_params)
115123
return await self._request("GET", url, params=params)
116124

117125
async def get_protocol(

src/protocol_mcp/services/protocols_io.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,12 @@ async def search_protocols(
121121
ProtocolSearchResponse
122122
Search results with pagination info.
123123
"""
124-
filter_params = {}
125-
if peer_reviewed_only:
126-
filter_params["filter"] = "peer_reviewed"
127-
else:
128-
# Default to searching public protocols
129-
filter_params["filter"] = "public"
130-
131-
# Use date ordering instead of relevance (which has a DB error)
132-
filter_params["order_field"] = "date"
133-
filter_params["order_dir"] = "desc"
124+
filter_type = "peer_reviewed" if peer_reviewed_only else "public"
134125

135126
response = await client.search_protocols(
136127
query=query,
137128
page_size=max_results,
138-
filter_params=filter_params,
129+
filter_type=filter_type,
139130
)
140131

141132
items = [_parse_search_item(item) for item in response.get("items", [])]

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)