Skip to main content

Document Tools

Tools for reading and writing document formats (PDF, images, Excel).

read_pdf

Extract text content from a PDF file.

ParameterTypeDescription
pathstringPath to PDF file
pagesstringPage range (e.g., "1-5", "3", optional)

Classification: Host

Return shape:

{
"status": "success",
"stdout": "extracted text from PDF pages",
"exit_code": 0,
"duration_ms": 200
}

read_image

Read an image file and return its contents for analysis.

ParameterTypeDescription
pathstringPath to image file

Classification: Host

Supported formats: PNG, JPEG, BMP, GIF, TIFF, WebP

Return shape:

{
"status": "success",
"stdout": "image description or base64 data",
"image_b64": "base64 encoded image",
"exit_code": 0,
"duration_ms": 50
}

read_excel

Read data from an Excel spreadsheet.

ParameterTypeDescription
pathstringPath to Excel file
sheetstringSheet name (optional, defaults to first sheet)
rangestringCell range (e.g., "A1:D10", optional)

Classification: Host

Supported formats: .xlsx, .xls, .csv

Return shape:

{
"status": "success",
"stdout": "tabular data as formatted text",
"exit_code": 0,
"duration_ms": 100
}

write_excel

Write data to an Excel spreadsheet.

ParameterTypeDescription
pathstringOutput file path
dataarrayArray of row arrays
sheetstringSheet name (optional)

Classification: Host (path-checked)

Return shape:

{
"status": "success",
"stdout": "Excel file written successfully",
"exit_code": 0,
"duration_ms": 150
}

convert_document

Convert a document to another format. Provided by the office-documents built-in skill.

ParameterTypeDescription
input_pathstringAbsolute path to the source document
output_formatstringTarget format: "pdf", "csv", "png", "jpg", "html" (default: "pdf")
output_pathstringWhere to save the result (optional — defaults to input file with new extension)
sheet_namestringFor spreadsheets, which sheet to convert (optional — defaults to active/first sheet)

Classification: Host (skill tool)

Conversion methods (auto-detected by priority):

PriorityMethodPlatformsFormatsNotes
1Microsoft Office COMWindowsPDFBest quality for Office files
2LibreOffice headlessAllPDF, CSV, PNG, JPG, HTMLInstall LibreOffice for broadest support
3Python (openpyxl + fpdf2)AllPDF, CSVFallback, basic formatting

Return shape:

{
"status": "success",
"output_path": "/path/to/output.pdf",
"method": "office_com",
"input_format": "xlsx",
"output_format": "pdf",
"duration_ms": 3500,
"voice_message": "Converted to pdf successfully."
}

Notes:

  • Automatically detects the best conversion method available on the system
  • Returns install_hint when a required Python package is missing (e.g., pip install fpdf2)
  • Requires load_skill(skill_name="office-documents") before first use

Related: Core Tools · File Tools