download_resource_preview
Download a resource file and preview a sample of rows with column headers to inspect data structure before querying.
Instructions
Download a resource and return N rows with their column headers.
The datos.gob.do portal has no DataStore (no SQL), so this tool downloads the file and parses it client-side. 5 MB cap to avoid huge files. Useful for inspecting the structure of the data before deciding how to query it. For analytical queries on big files, use get_resource_schema + summarize_resource (v0.2) or aggregate_resource (v0.3+).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Direct URL to the file (CKAN resource 'url' field). Supports CSV, TSV, XLSX, JSON. | |
| format | Yes | Format declared in CKAN ('format' field). Accepts: csv, tsv, xlsx, xls, json. | |
| rows | No | Rows to return (1-200). Default 20. | |
| sample | No | Which slice to return: 'head' (first N), 'tail' (last N of downloaded portion), or 'random' (uniform sample). For large files, prefer summarize_resource or aggregate_resource. | head |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| hint | No | ||
| format | No | ||
| source_url | No | ||
| columns | No | ||
| total_rows_in_download | No | ||
| rows_returned | No | ||
| sample_mode | No | ||
| bytes_downloaded | No | ||
| download_truncated | No | ||
| rows | No |