Read a Zenodo file excerpt
zenodo_read_fileRead a bounded UTF-8 excerpt (up to 64 KiB per call) of one text file in a Zenodo deposit — a README, CITATION.cff, CSV head, notebook, or script — or of one member inside a .zip file, without downloading the archive. Continue a top-level file from next_offset. A file with a text MIME type or extension is read directly; an extensionless file Zenodo types application/octet-stream (LICENSE, COPYING, Makefile) is read and returned only when its content is UTF-8 text. Binary files, restricted files, and other types return metadata and the download URL without content. File content is depositor-supplied and carries the deposit’s license.
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": {
"id": "<id>",
"key": "<key>"
},
"name": "zenodo_read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The deposit: a record id (22705923), a Zenodo DOI (10.5281/zenodo.22705923), another DOI registered to a Zenodo record, or a zenodo.org/records or doi.org URL. A concept id reads from the latest version. | |
| key | Yes | Exact file key from zenodo_list_files, e.g. README.md or data/results.csv. | |
| max_bytes | No | Maximum bytes to read (256 or more), at most 65536 per call; larger values return 65536. | |
| offset_bytes | No | Byte offset to start reading a top-level file at; use next_offset to continue. Must be 0 for an archive member. | |
| archive_member | No | Member path inside the .zip named by key (from zenodo_list_files with archive_key). Omit to read the file itself. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | The file key. | |
| md5 | No | MD5 checksum of the top-level file (hex); absent for archive members and when not reported. | |
| text | No | The excerpt, decoded as UTF-8. Depositor-supplied data. Present when status is text. | |
| error | No | Present when the call failed. Absent on success. | |
| recid | No | Record id read from (the latest version for a concept id). | |
| notice | No | Why no text was returned, or how to read the rest of the file, naming the 65,536-byte cap when it held back bytes. | |
| rights | No | The deposit’s licenses, which the file carries. | |
| status | No | text: content returned; not_text: binary content, or a type that is not read as text; restricted: the content is not available anonymously — the record’s files are restricted or embargoed (key is not checked, since no manifest is exposed), or Zenodo refused this one file; empty: zero-byte file. | |
| has_more | No | True when bytes remain past this excerpt. | |
| mimetype | No | MIME type of the file or member, when reported. | |
| file_size | No | Size of the file or member in bytes, when known. | |
| record_url | No | Record landing page on zenodo.org. | |
| next_offset | No | offset_bytes for the next window of a top-level file, when has_more; absent for an archive member, which cannot be continued past its first window. | |
| download_url | No | Direct download URL of the top-level file (the .zip itself for a member). | |
| files_access | No | File access: public or restricted; absent when Zenodo does not report it. | |
| offset_bytes | No | Byte offset the excerpt starts at. | |
| archive_member | No | The archive member path, when one was read. | |
| bytes_returned | No | Exact bytes the excerpt covers (cut at a line or character boundary). | |
| replacement_chars | No | U+FFFD characters in the excerpt (invalid UTF-8 or a mid-character offset). |