fileport

v0.1.0
io.github.CloudCorpRecords/fileport Checked 1 day ago Published 1 month ago

Sandboxed file access: read, write, edit and search in allowed dirs.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

read_file

Read the full contents of a file as text.

ParameterTypeDescription
path *stringPath of the file to read, inside one of the allowed directories.

read_text_file

Read a text file, optionally limited to its first or last lines.

ParameterTypeDescription
path *stringPath of the text file to read, inside one of the allowed directories.
headnumberReturn only the first N lines of the file; mutually exclusive with tail.
tailnumberReturn only the last N lines of the file; mutually exclusive with head.

read_media_file

Read a media file and return it as base64 content.

ParameterTypeDescription
path *stringPath of the media file to read, inside one of the allowed directories.

read_multiple_files

Read several files at once, reporting per-file failures in-band.

ParameterTypeDescription
paths *arrayPaths of the files to read, each inside one of the allowed directories.

write_file

Write text content to a file, creating parent folders as needed.

ParameterTypeDescription
content *stringText content to write to the file.
path *stringPath of the file to write, inside one of the allowed directories.

edit_file

Apply exact-match text replacements to a file, with an optional dry run.

ParameterTypeDescription
edits *arrayExact-match text replacements to apply to the file, in order.
path *stringPath of the file to edit, inside one of the allowed directories.
dryRunbooleanWhen true, report the changes that would be made without writing the file.

create_directory

Create a directory, including any missing parents.

ParameterTypeDescription
path *stringPath of the directory to create, inside one of the allowed directories.

list_directory

List the entries of a directory.

ParameterTypeDescription
path *stringPath of the directory to list, inside one of the allowed directories.

list_directory_with_sizes

List directory entries together with their sizes.

ParameterTypeDescription
path *stringPath of the directory to list, inside one of the allowed directories.
sortBystringSort the entries by name or by size.

directory_tree

Return a directory as a nested JSON tree.

ParameterTypeDescription
path *stringPath of the directory to return as a tree, inside one of the allowed directories.
excludePatternsarrayGlob patterns for paths to exclude from the tree.

move_file

Move or rename a file or directory.

ParameterTypeDescription
destination *stringNew path for the file or directory, inside one of the allowed directories.
source *stringCurrent path of the file or directory to move, inside one of the allowed directories.

search_files

Recursively search for files whose names match a glob pattern.

ParameterTypeDescription
path *stringDirectory to search recursively, inside one of the allowed directories.
pattern *stringGlob pattern matched against file names.
excludePatternsarrayGlob patterns for paths to exclude from the search.

get_file_info

Return metadata about a file or directory.

ParameterTypeDescription
path *stringPath of the file or directory to inspect, inside one of the allowed directories.

list_allowed_directories

List the directories this server is allowed to access.