list_sifts
Retrieve a list of sifts with their names, instructions, and document or record counts. Supports pagination with limit and offset parameters to control output size.
Instructions
List sifts with their name, instructions, and document/record counts.
Args:
limit: Maximum number of sifts to return (default 50, max 200)
offset: Number of sifts to skip for paginationInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Implementation Reference
- code/mcp/sifter_mcp/server.py:51-61 (handler)Primary MCP tool handler for list_sifts – decorated with @mcp.tool(), calls the async SDK client and returns paginated sift data.
@mcp.tool() async def list_sifts(limit: int = 50, offset: int = 0) -> dict: """List sifts with their name, instructions, and document/record counts. Args: limit: Maximum number of sifts to return (default 50, max 200) offset: Number of sifts to skip for pagination """ async with _get_client() as client: page = await client.list_sifts(limit=min(limit, 200), offset=offset) return {"items": [h._data for h in page.items], "total": page.total, "limit": page.limit, "offset": page.offset} - JSON schema for list_sifts used as a tool definition for LLM agent tool calling (liteLLM).
{ "type": "function", "function": { "name": "list_sifts", "description": "List all sifts available to the user with their name, status, and record counts.", "parameters": {"type": "object", "properties": {}, "required": []}, }, - code/mcp/sifter_mcp/server.py:51-61 (registration)Registration via @mcp.tool() decorator on FastMCP instance in the MCP server.
@mcp.tool() async def list_sifts(limit: int = 50, offset: int = 0) -> dict: """List sifts with their name, instructions, and document/record counts. Args: limit: Maximum number of sifts to return (default 50, max 200) offset: Number of sifts to skip for pagination """ async with _get_client() as client: page = await client.list_sifts(limit=min(limit, 200), offset=offset) return {"items": [h._data for h in page.items], "total": page.total, "limit": page.limit, "offset": page.offset} - Alternative server-side handler in AgentToolRunner._dispatch for list_sifts, used by the Q&A and widget agents.
if name == "list_sifts": sifts, _ = await self.sift_svc.list_all(limit=50, org_id=self.org_id) return [ { "id": s.id, "name": s.name, "description": s.description, "status": s.status, "processed_documents": s.processed_documents, "total_documents": s.total_documents, } for s in sifts ] - code/server/sifter/api/sifts.py:139-148 (handler)FastAPI REST endpoint for listing sifts, called by SDK client.list_sifts under the hood.
@router.get("", response_model=dict) async def list_sifts( limit: int = 50, offset: int = 0, principal: Principal = Depends(get_current_principal), db=Depends(get_db), ): svc = SiftService(db) sifts, total = await svc.list_all(skip=offset, limit=limit, org_id=principal.org_id) return paginated([_sift_to_dict(s) for s in sifts], total, limit, offset)