delete_sift
Permanently delete a sift and all its records. Provide the sift ID to remove the entire sift from the system.
Instructions
Delete a sift and all its records.
Args:
sift_id: The sift identifierInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sift_id | Yes |
Implementation Reference
- code/mcp/sifter_mcp/server.py:190-200 (handler)MCP tool handler for 'delete_sift' - deletes a sift and all its records via the SDK client.
@mcp.tool() async def delete_sift(sift_id: str) -> dict: """Delete a sift and all its records. Args: sift_id: The sift identifier """ async with _get_client() as client: handle = await client.get_sift(sift_id) await handle.delete() return {"deleted": True} - code/mcp/sifter_mcp/server.py:41-41 (registration)The FastMCP instance ('sifter') that registers all MCP tools including delete_sift via @mcp.tool().
mcp = FastMCP("sifter", streamable_http_path="/", stateless_http=True, transport_security=_transport_security) - code/server/sifter/api/sifts.py:216-232 (handler)FastAPI REST API handler for DELETE /api/sifts/{sift_id} - the server-side endpoint that performs the actual deletion with auth and DB cleanup.
@router.delete("/{sift_id}") async def delete_sift( sift_id: str, principal: Principal = Depends(get_current_principal), db=Depends(get_db), ): svc = SiftService(db) sift = await svc.get(sift_id, org_id=principal.org_id) if not sift: raise HTTPException(status_code=404, detail="Sift not found") deleted = await svc.delete(sift_id) if not deleted: raise HTTPException(status_code=404, detail="Sift not found") await db["folder_extractors"].delete_many({"sift_id": sift_id}) await db["document_sift_statuses"].delete_many({"sift_id": sift_id}) await db["processing_queue"].delete_many({"sift_id": sift_id, "status": {"$in": ["pending", "processing"]}}) return {"deleted": True} - SiftService.delete() - the service layer that performs the actual MongoDB deletion of a sift and its results.
async def delete(self, sift_id: str) -> bool: await self.results_service.delete_by_sift_id(sift_id) result = await self.col.delete_one({"_id": ObjectId(sift_id)}) return result.deleted_count > 0 - code/server/sifter/api/sifts.py:29-29 (registration)FastAPI router registration at /api/sifts - the route prefix under which delete_sift is registered as DELETE /{sift_id}.
router = APIRouter(prefix="/api/sifts", tags=["sifts"])