Skip to content

Commit 8bee857

Browse files
committed
Better and simpler tests
1 parent a2be6de commit 8bee857

File tree

5 files changed

+74
-270
lines changed

5 files changed

+74
-270
lines changed

src/cellosaurus_mcp/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
from importlib.metadata import version
22

3-
from cellosaurus_mcp.main import run_app
43
from cellosaurus_mcp.mcp import mcp
4+
from cellosaurus_mcp.tools import * # noqa: F403 import all tools to register them
55

66
__version__ = version("cellosaurus_mcp")
77

8-
__all__ = ["mcp", "run_app", "__version__"]
9-
10-
11-
if __name__ == "__main__":
12-
run_app()
8+
__all__ = ["mcp", "__version__"]

src/cellosaurus_mcp/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import click
66

7-
from .tools import * # noqa: F403 import all tools to register them
8-
97

108
class EnvironmentType(enum.Enum):
119
"""Environment type for MCP server."""

src/cellosaurus_mcp/tools/cellosaurus_tools.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from cellosaurus_mcp.models import CellLineRequest, CellosaurusField, ReleaseInfoRequest, SearchRequest
1010

1111

12-
@mcp.tool
12+
@mcp.tool()
1313
async def search_cell_lines(
1414
query: str = "id:HeLa",
1515
fields: list[str] | None = None,
@@ -62,7 +62,7 @@ async def search_cell_lines(
6262
return {"error": f"Search failed: {str(e)}"}
6363

6464

65-
@mcp.tool
65+
@mcp.tool()
6666
async def get_cell_line_info(
6767
accession: str,
6868
fields: list[str] | None = None,
@@ -96,7 +96,7 @@ async def get_cell_line_info(
9696
return {"error": f"Failed to get cell line info: {str(e)}"}
9797

9898

99-
@mcp.tool
99+
@mcp.tool()
100100
async def get_release_info() -> dict[str, Any]:
101101
"""Get information about the current Cellosaurus database release.
102102
@@ -112,7 +112,7 @@ async def get_release_info() -> dict[str, Any]:
112112
return {"error": f"Failed to get release info: {str(e)}"}
113113

114114

115-
@mcp.tool
115+
@mcp.tool()
116116
async def find_cell_lines_by_disease(
117117
disease: str,
118118
species: str = "human",
@@ -138,14 +138,14 @@ async def find_cell_lines_by_disease(
138138

139139
query = " ".join(query_parts)
140140

141-
return await search_cell_lines(
141+
return await search_cell_lines.fn( # type: ignore[attr-defined]
142142
query=query,
143143
fields=fields or ["id", "ac", "di", "ox", "derived-from-site"],
144144
rows=limit,
145145
)
146146

147147

148-
@mcp.tool
148+
@mcp.tool()
149149
async def find_cell_lines_by_tissue(
150150
tissue: str,
151151
species: str = "human",
@@ -171,14 +171,14 @@ async def find_cell_lines_by_tissue(
171171

172172
query = " ".join(query_parts)
173173

174-
return await search_cell_lines(
174+
return await search_cell_lines.fn( # type: ignore[attr-defined]
175175
query=query,
176176
fields=fields or ["id", "ac", "derived-from-site", "ox", "cell-type"],
177177
rows=limit,
178178
)
179179

180180

181-
@mcp.tool
181+
@mcp.tool()
182182
def list_available_fields() -> dict[str, str]:
183183
"""Get a list of all available fields that can be requested from the Cellosaurus API.
184184

0 commit comments

Comments
 (0)