Skip to main content

talonic_spec_create

Create a Spec (a saved extraction pipeline: the fields to capture and the steps that produce them). Not live until published.

How an agent uses it

  • Use it when: the user wants a new pipeline for a kind of document, or wants to bring in a Spec JSON export or an existing schema.
  • Arguments: name; optional description; then ONE of: doc (a complete Spec document), spec_json (a Spec JSON export from the editor), schema_id (an existing schema to turn into a Spec), or nothing (empty draft).
  • A minimal valid doc: {"format":1,"name":"Invoices","fields":[{"field_id":"f-vendor","name":"vendor_name","data_type":"string","description":"Legal name of the issuing company"},{"field_id":"f-total","name":"total_amount","data_type":"number"}],"stages":[{"id":"s-source","type":"source"},{"id":"s-extract","type":"extraction","config":{}},{"id":"s-deliver","type":"deliver"}],"gates":[],"policies":[]}. Give every field a stable, unique field_id and a clear description of what to capture.
  • Returns: { spec_id, revision, doc, has_unpublished_changes, links } (or { spec_id, issues } for an import). Next: talonic_spec_check.

Availability

Listed when your workspace role can build and change Specs. Being listed only means the tool is visible: Talonic checks your role again on every call.

Behaviour and cost

  • Not read-only. It can add to or change workspace data.

Parameters

ParameterTypeDescription
name *string—
descriptionstring—
docobjectA complete Spec document
spec_jsonobjectA Spec JSON export from the Spec editor
schema_idstringAn existing schema to turn into a Spec

Example

Example
// talonic_spec_create({ "name": "Invoices", "doc": { "format": 1, "name": "Invoices", "fields": [{ "field_id": "f-total", "name": "total_amount", "data_type": "number" }], "stages": [{ "id": "s-source", "type": "source" }, { "id": "s-extract", "type": "extraction", "config": {} }, { "id": "s-deliver", "type": "deliver" }], "gates": [], "policies": [] } })
{ "spec_id": "1111…", "revision": 1, "published_version": null, "has_unpublished_changes": true }

Errors

A failed call comes back as a tool error with the HTTP status and a message that says what to change. Troubleshooting lists the common ones.

Frequently asked questions

Is a new Spec live?+
No. It is a draft until talonic_spec_publish.