run_extraction
Trigger extraction process for a document using a specific sift to convert unstructured content into structured, queryable data.
Instructions
Enqueue extraction for a document on a specific sift.
Args:
document_id: The document identifier
sift_id: The sift to extract withInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | ||
| sift_id | Yes |
Implementation Reference
- code/mcp/sifter_mcp/server.py:229-239 (handler)The core handler function for the run_extraction MCP tool. It gets a sift handle by ID and calls extract() on it with the given document_id to enqueue extraction.
@mcp.tool() async def run_extraction(document_id: str, sift_id: str) -> dict: """Enqueue extraction for a document on a specific sift. Args: document_id: The document identifier sift_id: The sift to extract with """ async with _get_client() as client: handle = await client.get_sift(sift_id) return await handle.extract(document_id) - code/mcp/sifter_mcp/server.py:41-41 (registration)The MCP server instance (FastMCP) that the @mcp.tool() decorator registers the run_extraction function with.
mcp = FastMCP("sifter", streamable_http_path="/", stateless_http=True, transport_security=_transport_security) - code/zapier/index.js:236-259 (handler)The Zapier action definition for run_extraction, performing a POST to /api/sifts/{sift_id}/extract with the document_id.
const actionRunExtraction = { key: "run_extraction", noun: "Extraction", display: { label: "Run Extraction", description: "Trigger extraction of a document against a sift.", }, operation: { inputFields: [ { key: "sift_id", label: "Sift", dynamic: "sift_choices.id.name", required: true }, { key: "document_id", label: "Document ID", required: true }, ], perform: async (z, bundle) => { const resp = await z.request({ method: "POST", url: `${apiUrl(bundle)}/api/sifts/${bundle.inputData.sift_id}/extract`, headers: headers(bundle), body: { document_id: bundle.inputData.document_id }, }); return resp.data; }, sample: { task_id: "sample-task-id", status: "queued" }, }, }; - code/zapier/index.js:350-350 (registration)Registration of the run_extraction action in the Zapier app module exports under the 'actions' object.
[actionRunExtraction.key]: actionRunExtraction,