All data sources

Document Ingestion

OAuthdocument_ingestion

Unified OneDrive + SharePoint document ingestion and structured extraction. CRITICAL USAGE RULES: 1. Use ingest_onedrive_folder() to list/search OneDrive files, download, parse, and normalize. 2. Use ingest_sharepoint_library() to resolve site/drive, ingest library files, and normalize. 3. Parsers support: PDF, CSV, XLSX/XLS, DOCX/DOC, TXT (max file size configurable). 4. Incremental mode supports existing itemId + etag/lastModified to skip unchanged files. 5. Use extract_structured_data() for strict typed extraction (invoice, lease, report). 6. Use upsert_document_record() to keep raw text and extracted JSON separate in a deterministic record shape.

Provenance

PublisherDocument Ingestion

Freshness & coverage

FreshnessFreshness not declared
GeographicNot declared
TemporalNot declared
AuthenticationCredentials required (OAuth)

Methods (5)

  • parse_document

    unknown

    Parse document text from a URL, share link, drive item, or content.

    Input schema
    {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "shareUrl": {
          "type": "string"
        },
        "driveId": {
          "type": "string"
        },
        "itemId": {
          "type": "string"
        },
        "contentBase64": {
          "type": "string"
        },
        "fileName": {
          "type": "string"
        },
        "maxFileSizeMB": {
          "type": "number"
        },
        "maxParsedTextChars": {
          "type": "number"
        }
      },
      "additionalProperties": false
    }
  • ingest_onedrive_folder

    unknown

    Bulk document ingestion: parse and normalize every file in a OneDrive folder into clean text.

    Entitiesdocument
    Input schema
    {
      "type": "object",
      "properties": {
        "driveId": {
          "type": "string"
        },
        "folderId": {
          "type": "string",
          "description": "Optional OneDrive folder ID."
        },
        "query": {
          "type": "string",
          "description": "Optional search query."
        },
        "limit": {
          "type": "number"
        },
        "top": {
          "type": "number"
        },
        "select": {
          "type": "string"
        },
        "fetchAll": {
          "type": "boolean"
        },
        "maxPages": {
          "type": "number"
        },
        "fileTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed file extensions such as pdf, docx, or xlsx."
        },
        "maxFileSizeMB": {
          "type": "number"
        },
        "maxParsedTextChars": {
          "type": "number"
        },
        "skipUnchanged": {
          "type": "boolean",
          "description": "Skip unchanged files."
        },
        "existingDocuments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "oneOf": [
                  {
                    "type": "string",
                    "enum": [
                      "onedrive"
                    ]
                  },
                  {
                    "type": "string",
                    "enum": [
                      "sharepoint"
                    ]
                  }
                ]
              },
              "siteId": {
                "type": "string"
              },
              "driveId": {
                "type": "string"
              },
              "itemId": {
                "type": "string"
              },
              "etag": {
                "type": "string"
              },
              "lastModified": {
                "type": "string"
              }
            },
            "required": [
              "itemId"
            ],
            "additionalProperties": false
          }
        },
        "folderPath": {
          "type": "string",
          "description": "Optional OneDrive folder path."
        }
      },
      "additionalProperties": true
    }
  • ingest_sharepoint_library

    unknown

    Bulk document ingestion: parse and normalize every file in a SharePoint library into clean text.

    Entitiesdocument
    Input schema
    {
      "type": "object",
      "properties": {
        "siteId": {
          "type": "string",
          "description": "Optional SharePoint site ID."
        },
        "siteQuery": {
          "type": "string",
          "description": "Optional SharePoint site search query."
        },
        "driveId": {
          "type": "string",
          "description": "Optional SharePoint drive ID."
        },
        "query": {
          "type": "string",
          "description": "Optional search query."
        },
        "top": {
          "type": "number"
        },
        "fetchAll": {
          "type": "boolean"
        },
        "fileTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed file extensions such as pdf, docx, or xlsx."
        },
        "maxFileSizeMB": {
          "type": "number"
        },
        "maxParsedTextChars": {
          "type": "number"
        },
        "skipUnchanged": {
          "type": "boolean",
          "description": "Skip unchanged files."
        },
        "existingDocuments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "oneOf": [
                  {
                    "type": "string",
                    "enum": [
                      "onedrive"
                    ]
                  },
                  {
                    "type": "string",
                    "enum": [
                      "sharepoint"
                    ]
                  }
                ]
              },
              "siteId": {
                "type": "string"
              },
              "driveId": {
                "type": "string"
              },
              "itemId": {
                "type": "string"
              },
              "etag": {
                "type": "string"
              },
              "lastModified": {
                "type": "string"
              }
            },
            "required": [
              "itemId"
            ],
            "additionalProperties": false
          }
        },
        "downloadByPath": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    }
  • extract_structured_data

    unknown

    Extract structured fields from normalized documents.

    Required paramsschemaTypedocuments
    Input schema
    {
      "type": "object",
      "properties": {
        "schemaType": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "invoice"
              ]
            },
            {
              "type": "string",
              "enum": [
                "lease"
              ]
            },
            {
              "type": "string",
              "enum": [
                "report"
              ]
            }
          ],
          "type": "string",
          "description": "Extraction schema such as invoice, lease, or report."
        },
        "schema": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "invoice"
              ]
            },
            {
              "type": "string",
              "enum": [
                "lease"
              ]
            },
            {
              "type": "string",
              "enum": [
                "report"
              ]
            }
          ]
        },
        "text": {
          "type": "string"
        },
        "itemId": {
          "type": "string"
        },
        "document": {
          "type": "object",
          "properties": {
            "source": {
              "oneOf": [
                {
                  "type": "string",
                  "enum": [
                    "onedrive"
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "sharepoint"
                  ]
                }
              ]
            },
            "siteId": {
              "type": "string"
            },
            "driveId": {
              "type": "string"
            },
            "itemId": {
              "type": "string"
            },
            "fileName": {
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "etag": {
              "type": "string"
            },
            "lastModified": {
              "type": "string"
            },
            "contentType": {
              "type": "string"
            },
            "sizeBytes": {
              "type": "number"
            },
            "parsed": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "fileType": {
                  "type": "string"
                },
                "pageCount": {
                  "type": "number"
                },
                "sheetCount": {
                  "type": "number"
                },
                "wordCount": {
                  "type": "number"
                },
                "ocrRequired": {
                  "type": "boolean"
                },
                "truncated": {
                  "type": "boolean"
                }
              },
              "required": [
                "text",
                "fileType"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "source",
            "itemId",
            "fileName",
            "parsed"
          ],
          "additionalProperties": false
        },
        "documents": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Normalized documents to extract from."
        }
      },
      "additionalProperties": true,
      "required": [
        "schemaType",
        "documents"
      ]
    }
  • upsert_document_record

    write

    Merge normalized documents and extracted data into deterministic records.

    Required paramsrecords
    Input schema
    {
      "type": "object",
      "properties": {
        "record": {
          "type": "object",
          "properties": {
            "document": {
              "type": "object",
              "properties": {
                "source": {
                  "oneOf": [
                    {
                      "type": "string",
                      "enum": [
                        "onedrive"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "sharepoint"
                      ]
                    }
                  ]
                },
                "siteId": {
                  "type": "string"
                },
                "driveId": {
                  "type": "string"
                },
                "itemId": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "etag": {
                  "type": "string"
                },
                "lastModified": {
                  "type": "string"
                },
                "contentType": {
                  "type": "string"
                },
                "sizeBytes": {
                  "type": "number"
                },
                "parsed": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "fileType": {
                      "type": "string"
                    },
                    "pageCount": {
                      "type": "number"
                    },
                    "sheetCount": {
                      "type": "number"
                    },
                    "wordCount": {
                      "type": "number"
                    },
                    "ocrRequired": {},
                    "truncated": {}
                  },
                  "required": [
                    "text",
                    "fileType"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "source",
                "itemId",
                "fileName",
                "parsed"
              ],
              "additionalProperties": false
            },
            "extracted": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "documentType": {
                      "type": "string",
                      "enum": [
                        "invoice"
                      ]
                    },
                    "invoiceNumber": {},
                    "invoiceDate": {},
                    "dueDate": {},
                    "vendorName": {},
                    "customerName": {},
                    "totalAmount": {},
                    "currency": {},
                    "purchaseOrderNumber": {}
                  },
                  "required": [
                    "documentType",
                    "invoiceNumber",
                    "invoiceDate",
                    "dueDate",
                    "vendorName",
                    "customerName",
                    "totalAmount",
                    "currency",
                    "purchaseOrderNumber"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "documentType": {
                      "type": "string",
                      "enum": [
                        "lease"
                      ]
                    },
                    "lessor": {},
                    "lessee": {},
                    "effectiveDate": {},
                    "expirationDate": {},
                    "monthlyRent": {},
                    "securityDeposit": {},
                    "propertyAddress": {},
                    "governingState": {}
                  },
                  "required": [
                    "documentType",
                    "lessor",
                    "lessee",
                    "effectiveDate",
                    "expirationDate",
                    "monthlyRent",
                    "securityDeposit",
                    "propertyAddress",
                    "governingState"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "documentType": {
                      "type": "string",
                      "enum": [
                        "report"
                      ]
                    },
                    "title": {},
                    "reportDate": {},
                    "author": {},
                    "organization": {},
                    "summary": {}
                  },
                  "required": [
                    "documentType",
                    "title",
                    "reportDate",
                    "author",
                    "organization",
                    "summary"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "document"
          ],
          "additionalProperties": false
        },
        "records": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Document/extraction record pairs."
        },
        "existingRecords": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Existing stored records for incremental merging."
        }
      },
      "additionalProperties": true,
      "required": [
        "records"
      ]
    }