run_extraction
Enqueue an extraction job to structure a document into typed, queryable records using a specified sift.
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 main tool handler for 'run_extraction' as a FastMCP tool. It takes document_id and sift_id, gets the sift handle, and calls handle.extract(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.tool() decorator on line 229 registers the 'run_extraction' function as an MCP tool on the FastMCP server instance 'mcp'.
mcp = FastMCP("sifter", streamable_http_path="/", stateless_http=True, transport_security=_transport_security) - code/zapier/index.js:236-259 (handler)Zapier integration action definition for 'run_extraction' — sends a POST to /api/sifts/{sift_id}/extract with the document_id to trigger extraction.
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:347-351 (registration)Registration of the run_extraction action in the Zapier app's actions export.
actions: { [actionUploadDocument.key]: actionUploadDocument, [actionCreateSift.key]: actionCreateSift, [actionRunExtraction.key]: actionRunExtraction, }, - code/zapier/index.js:244-247 (schema)Input schema for the run_extraction action — requires sift_id (dynamic dropdown) and document_id (text).
inputFields: [ { key: "sift_id", label: "Sift", dynamic: "sift_choices.id.name", required: true }, { key: "document_id", label: "Document ID", required: true }, ],