get_sift
Retrieve metadata and extraction schema for a specific sift to understand its typed record structure and fields.
Instructions
Get sift metadata and inferred extraction schema for a specific sift.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sift_id | Yes |
Implementation Reference
- code/mcp/sifter_mcp/server.py:64-69 (handler)The MCP tool handler for 'get_sift'. Decorated with @mcp.tool(), it asynchronously gets a sift by ID via the SDK client and returns its data dict.
@mcp.tool() async def get_sift(sift_id: str) -> dict: """Get sift metadata and inferred extraction schema for a specific sift.""" async with _get_client() as client: handle = await client.get_sift(sift_id) return handle._data if hasattr(handle, "_data") else {"sift_id": sift_id} - code/mcp/sifter_mcp/server.py:65-65 (schema)Input schema: the tool accepts a single `sift_id: str` parameter.
async def get_sift(sift_id: str) -> dict: - code/mcp/sifter_mcp/server.py:64-64 (registration)Registered as an MCP tool via the `@mcp.tool()` decorator on the `get_sift` async function.
@mcp.tool() - SDK helper - `AsyncSifter.get_sift()` makes the actual HTTP GET request to `/api/sifts/{sift_id}` and returns an AsyncSiftHandle.
async def get_sift(self, sift_id: str) -> AsyncSiftHandle: async with httpx.AsyncClient() as http: r = await http.get( f"{self.api_url}/api/sifts/{sift_id}", headers=self._auth_headers(), ) r.raise_for_status() return AsyncSiftHandle(r.json(), self) - SDK helper - synchronous `Sifter.get_sift()` makes HTTP GET request to `/api/sifts/{sift_id}`.
def get_sift(self, sift_id: str) -> SiftHandle: """Get a handle to an existing sift.""" import httpx with httpx.Client() as http: r = http.get( f"{self.api_url}/api/sifts/{sift_id}", headers=self._auth_headers(), ) r.raise_for_status() return SiftHandle(r.json(), self)