Contract Validation
ivy.agent.contract-validation · v1.1.0
ivyx
Reads a contract PDF, has a model pull out the parties and the terms, and checks them against a schema.
Steps
In the order the agent's file lists them, each with where its inputs come from and the values the file fixes. A branch or a loop is a step too.
- 01Ivy NodeRead the PDFivy.node.pdf-text
Extracts the text of a PDF file, page by page and as one text, with the page count.
- takes
pathfrom the agent's input- returns
page_count
- 02Model turnExtract the terms
Extract the following fields as a JSON object: parties (list of two strings), start_date (string), term_months (number), monthly_fee_eur (number), notice_days (number). If a field is missing or not a number, use null.
- takes
contextfrom step 1,text- returns
contract_json
- 03Ivy NodeCheck the fieldsivy.node.schema-validator
Checks a payload against a JSON Schema subset and reports every problem it finds, not just the first.
- takes
payloadfrom step 2,output.contract_json- set
schema{"type":"object","properties":{"parties":{"type":"array","items":{"type":"string"}},"start_date":{"type":"string"},"t...modereport- returns
valid,problems
Nodes it brings
Adding this agent in IVYX Studio adds these nodes with it. A node your workspace already has is kept as it is, even at another version.
What it touches
Collected from what each of its nodes declares and what the agent's own file declares, such as moving a robot, plus the model call when a step is a model turn. A declaration is the author's statement, and it is what policy rules select on.
Inputs
| Field | Type | Description |
|---|---|---|
| pathrequired | string | The contract PDF. |
Outputs
| Field | Type | Description |
|---|---|---|
| contract_json | object | The parties, start date, term, monthly fee and notice period. |
| valid | boolean | True when every field is present and of the right kind. |
| problems | array | One sentence per problem. |
| page_count | integer | How many pages the PDF has. |
Tests
2 of 2 test cases passed on Oct 7, 2026, in the publisher's own environment, before this version was published. The registry keeps that record; it does not run the cases again.
Requires: python:3.9, a model core
- service-agreement
Terms of a 12-month service agreement, checked against the schema.
- given
pathdata/contract.pdf- expects
validequals truecontract_json.term_monthsequals 12contract_json.monthly_fee_eurequals 2500contract_json.notice_daysequals 60
- maintenance-agreement
Another contract gives other terms.
- given
pathdata/contract-b.pdf- expects
validequals truecontract_json.term_monthsequals 24contract_json.monthly_fee_eurequals 3100contract_json.notice_daysequals 90