← All ivy-agents
IVYXSTUDIO · IVY AGENT
C

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.

  1. 01
    Read the PDF
    ivy.node.pdf-text

    Extracts the text of a PDF file, page by page and as one text, with the page count.

    takes
    path from the agent's input
    returns
    page_count
    Ivy Node
  2. 02
    Extract 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
    context from step 1, text
    returns
    contract_json
    Model turn
  3. 03
    Check the fields
    ivy.node.schema-validator

    Checks a payload against a JSON Schema subset and reports every problem it finds, not just the first.

    takes
    payload from step 2, output.contract_json
    set
    schema {"type":"object","properties":{"parties":{"type":"array","items":{"type":"string"}},"start_date":{"type":"string"},"t...
    mode report
    returns
    valid, problems
    Ivy Node

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.

Calls a model

Inputs

FieldTypeDescription
pathrequiredstringThe contract PDF.

Outputs

FieldTypeDescription
contract_jsonobjectThe parties, start date, term, monthly fee and notice period.
validbooleanTrue when every field is present and of the right kind.
problemsarrayOne sentence per problem.
page_countintegerHow 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
    path data/contract.pdf
    expects
    valid equals true
    contract_json.term_months equals 12
    contract_json.monthly_fee_eur equals 2500
    contract_json.notice_days equals 60
  • maintenance-agreement

    Another contract gives other terms.

    given
    path data/contract-b.pdf
    expects
    valid equals true
    contract_json.term_months equals 24
    contract_json.monthly_fee_eur equals 3100
    contract_json.notice_days equals 90