datafile inspect

File Inspect

file_inspect

Inspects a local file without reading its full contents. Returns path, size, extension, detected text/binary type, encoding estimate, SHA-256 hash, line count for text files, and a bounded preview. Use when: deciding how to safely read or process a file before using a data tool. Scope: local filesystem only. Read-only; previews are capped at 8 KB. Not for: searching many files (use file_search), profiling structured data (use data_profile), or modifying files.

How to use file_inspect

Provide only the required inputs below. Start with the smallest scope that answers the task, then review the risk properties before an agent executes the call.

Risk and execution properties

Read only: yes

Destructive: no

Idempotent: yes

Open world: no — operates locally or through configured services

Inputs

pathstringrequired

Absolute or relative path to a readable local file.

include_hashboolean

Calculate SHA-256. Default: true.

Default: true

preview_bytesinteger

Bytes to preview from the file start. Default: 2048. Max: 8192.

Default: 2048

Example input

{
  "path": "<string>",
  "include_hash": true,
  "preview_bytes": 2048
}

Browse or search the full 74-tool reference to choose the smallest suitable capability.

Browse all tools →