Export file metadata
export_metadataExports a file or folder's metadata as JSON or CSV text, either returned directly or saved to a new file for quoting, diffing, or record-keeping.
Instructions
Export the read_metadata data of a file or folder as one JSON or CSV text, returned or saved as a new file. Use when: you need the metadata as a document to quote, diff or keep next to the data. Instead: read_metadata for structured fields. Requires: --mcp-tools metadata. Behavior: without out it writes nothing; reads as read_metadata does. A returned text over 16 MiB fails; save a big folder's with out. With out: only adds; each call adds a file, written via a temporary name; new local files are mode 0600. Time limit: 5 min. Returns: {path, format, files (number of file reports), truncated, text}; with out {path, out (the file written), format, files, truncated, size (bytes)}.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "export_metadata"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Save the text as this new file on path's backend instead of returning it (absolute, or relative to the MCP root); its folder must exist, a taken name gets ' (2)', ' (3)' ... ('meta (2).json'). Default: none, the text is returned. | |
| path | No | A file, or a folder whose supported files are read (absolute, or relative to the MCP root). Required unless path_b64 is given. | |
| format | No | Text format. json: {"files": [<read_metadata file report>, ...]}; csv: header path,kind,group,field,value,removable,error and one row per field, cells that would start a spreadsheet formula prefixed with '. | json |
| backend | No | Backend id from list_backends; omit for the default. | |
| out_b64 | No | out as base64 of its raw bytes, for non-UTF-8 names; replaces out. | |
| path_b64 | No | path as base64 of its raw bytes, for non-UTF-8 names; replaces path. | |
| max_files | No | For a folder: take at most this many files; more sets truncated=true. Ignored for a file. | |
| recursive | No | For a folder: also take the files in its subfolders (false: the folder's own files only). Ignored for a file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | with out: the file written (a taken name gets a counter) | |
| path | Yes | ||
| size | No | with out: bytes written | |
| text | No | the export; absent with out | |
| files | Yes | ||
| format | Yes | ||
| truncated | Yes |