@@ -353,17 +353,15 @@ async def test_list_search_term_filters(self, nc_mcp: McpTestHelper) -> None:
353353 assert result ["nb_bills" ] == 2 # search doesn't affect the count
354354
355355 @pytest .mark .asyncio
356- async def test_list_search_term_without_limit_is_ignored (self , nc_mcp : McpTestHelper ) -> None :
357- """Documents the Cospend quirk: searchTerm has no effect without a limit ."""
356+ async def test_list_search_term_without_limit_raises (self , nc_mcp : McpTestHelper ) -> None :
357+ """search_term without limit must fail fast — Cospend silently ignores it otherwise ."""
358358 pid = "mcp-test-bill-searchnolim"
359359 await _make_project (nc_mcp , pid )
360360 alice = await _make_member (nc_mcp , pid , "Alice" )
361- bob = await _make_member (nc_mcp , pid , "Bob" )
362- await _make_bill (nc_mcp , pid , "Pizza" , 20.0 , alice ["id" ], [alice ["id" ], bob ["id" ]])
363- await _make_bill (nc_mcp , pid , "Sushi" , 30.0 , alice ["id" ], [alice ["id" ], bob ["id" ]])
364- result = json .loads (await nc_mcp .call ("list_cospend_bills" , project_id = pid , search_term = "Pizz" ))
365- # Without limit, both bills come back — search is silently ignored.
366- assert sorted (b ["what" ] for b in result ["bills" ]) == ["Pizza" , "Sushi" ]
361+ await _make_member (nc_mcp , pid , "Bob" )
362+ await _make_bill (nc_mcp , pid , "Pizza" , 20.0 , alice ["id" ], [alice ["id" ]])
363+ with pytest .raises (ToolError , match = "limit is required" ):
364+ await nc_mcp .call ("list_cospend_bills" , project_id = pid , search_term = "Pizz" )
367365
368366 @pytest .mark .asyncio
369367 async def test_list_payer_id_filters (self , nc_mcp : McpTestHelper ) -> None :
0 commit comments