add_document
Adds a document row to a COBie Excel file, linking a file to an entity, with validation before writing.
Instructions
Add a new COBie Document row to link a file/reference to a COBie entity.
Proactive validation: calls validate_document_input internally before writing.
Args:
excel_path: Path to COBie Excel file
name: Unique document identifier (e.g. 'DOC-2026-001')
sheet_name: Target sheet (Component, Type, Space, Floor, etc.)
row_name: Target entity name (must exist in target sheet)
category: Document type from PickList.DocumentType
approval_by: Approver from PickList.ApprovalBy
stage: Stage from PickList.StageType
directory: File directory path or 'n/a'
file: File name or 'n/a'
description: Document description (default 'n/a')
reference: External reference URL (default 'n/a')
actor_contact: Contact creating the document (CreatedBy)
as_of_date: Creation date (defaults to today)
dry_run: Preview changes without writing
Returns:
Result with success status, created row number, and any errors.
Example:
add_document(
excel_path="project.xlsx",
name="DOC-AHU1-MANUAL",
sheet_name="Component",
row_name="AHU-1",
category="Operation and Maintenance",
approval_by="Information Only",
stage="As Built",
directory="/docs/equipment",
file="AHU-1-manual.pdf",
description="Equipment operation manual",
actor_contact={"email": "user@company.com", "company": "ACME", "phone": "555-1234", "category": "CM"}
)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"excel_path": "<excel_path>",
"name": "<name>",
"sheet_name": "<sheet_name>",
"row_name": "<row_name>",
"category": "<category>",
"approval_by": "<approval_by>",
"stage": "<stage>"
},
"name": "add_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | n/a | |
| name | Yes | ||
| stage | Yes | ||
| dry_run | No | ||
| category | Yes | ||
| row_name | Yes | ||
| directory | No | n/a | |
| reference | No | n/a | |
| as_of_date | No | ||
| excel_path | Yes | ||
| sheet_name | Yes | ||
| approval_by | Yes | ||
| description | No | n/a | |
| actor_contact | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||