Overview

Tool Name

file_manager_tools

Purpose

The file_manager_tools provide unified file operations across the platform. Use them to upload or register files, attach them to entities like projects or threads, preview large text safely, create download links, and streamline Git to storage workflows with a single call.

Functions Available

All items below are actions of file_manager_tool.
  1. UPLOAD_FILE: Upload a new text or binary file and optionally attach it immediately.
  2. REGISTER_EXISTING_FILE: Register a file that already exists on disk so it is tracked by the system.
  3. REGISTER_FILE_FROM_STORAGE: Register a file from a storage path and assign a friendly filename.
  4. SAVE_FROM_GIT: Copy from repo to managed storage, register, and attach in one efficient call.
  5. LIST_FILES: List files with filters such as project, data agent, thread, or index.
  6. GET_FILE_INFO: Return metadata for a file by id.
  7. GET_FILE_CONTENT: Read text content with pagination by lines or characters.
  8. GET_FILE_BY_PATH: Resolve a file record using an absolute storage path.
  9. ATTACH_FILE: Attach a registered file to a specific entity.
  10. DETACH_FILE: Remove an entity association without deleting the file.
  11. DOWNLOAD_FILE: Create a safe download link token for user delivery.
  12. DELETE_FILE: Permanently delete a file.

Key Features

Upload and Register

Add new files or register existing ones with rich metadata.

Attach to Entities

Link files to projects, todos, data agents, threads, messages, or indices for traceability.

Search and Filter

Find files quickly with scoped filters across related entities.

Read and Preview

Page through large text or code safely by lines or characters.

Save from Git

One call to save from repo, register, and attach for fast handoffs.

Share Securely

Generate expiring download links for stakeholders.

Input Parameters for Each Function

file_manager_tool

UPLOAD_FILE

NameDefinitionFormat
actionMust be UPLOAD_FILE.String
filenameDescriptive filename.String
text_contentPlain text content to store.String
contentBase64 payload for binaries.String
mime_typeMIME type for correct handling.String
entity_typeEntity to attach on upload.String
entity_idTarget entity id.String
Use descriptive filenames that encode purpose, owner, and date to improve discoverability in LIST_FILES.

LIST_FILES

NameDefinitionFormat
actionMust be LIST_FILES.String
filtersFilter object. Start with {"bot": "<bot_id>"} or a project id.Object

GET_FILE_INFO

NameDefinitionFormat
actionMust be GET_FILE_INFO.String
file_idUnique file identifier.String

GET_FILE_CONTENT

NameDefinitionFormat
actionMust be GET_FILE_CONTENT.String
file_idUnique file identifier.String
pagination_modelines, chars, or null for chunk based.String
startZero based offset for the chosen mode.Integer
countNumber of lines or chars to return.Integer
Prefer pagination_mode: "lines" for code or SQL, and pagination_mode: "chars" for prose or logs to keep previews snappy.

GET_FILE_BY_PATH

NameDefinitionFormat
actionMust be GET_FILE_BY_PATH.String
file_pathAbsolute storage path to resolve.String

REGISTER_FILE_FROM_STORAGE

NameDefinitionFormat
actionMust be REGISTER_FILE_FROM_STORAGE.String
filenameFriendly filename to display.String
file_pathPath to file in storage.String

REGISTER_EXISTING_FILE

NameDefinitionFormat
actionMust be REGISTER_EXISTING_FILE.String
file_pathAbsolute path to existing file.String
filenameDescriptive filename.String

ATTACH_FILE

NameDefinitionFormat
actionMust be ATTACH_FILE.String
file_idFile to attach.String
entity_typeOne of project todo asset bot thread message index.String
entity_idTarget id for the attachment.String

DETACH_FILE

NameDefinitionFormat
actionMust be DETACH_FILE.String
file_idFile to detach.String
entity_typeEntity type to remove.String
entity_idTarget id to remove from.String

DOWNLOAD_FILE

NameDefinitionFormat
actionMust be DOWNLOAD_FILE.String
file_idFile to create a download link for.String

DELETE_FILE

NameDefinitionFormat
actionMust be DELETE_FILE.String
file_idFile to remove permanently.String

SAVE_FROM_GIT

NameDefinitionFormat
actionMust be SAVE_FROM_GIT.String
source_pathAbsolute path to the repo file.String
target_pathDestination directory in managed storage.String
target_filenameOptional new filename.String
commit_messageOptional provenance message.String
entity_typeEntity to auto attach.String
entity_idTarget entity id.String
**Deletion is permanent. **Confirm backups or retention requirements before calling DELETE_FILE.

Use Cases

  1. Project evidence
    • Attach specs and extracts to a project for review and sign off.
  2. Repo handoff
    • Save a generated PDF from repo to storage and attach it to the current thread.
  3. Inventory discovery
    • List and filter files by project or data agent to locate the latest assets quickly.
  4. Large log review
    • Page through big SQL logs without loading the entire file.
  5. Stakeholder delivery
    • Generate a download link for stakeholders to retrieve a produced report.

Workflow/How It Works

  1. Upload or register files with UPLOAD_FILE or REGISTER_*.
  2. Attach to the relevant entity with ATTACH_FILE for context.
  3. Explore inventory via LIST_FILES and fetch metadata using GET_FILE_INFO.
  4. Preview text safely with GET_FILE_CONTENT and pagination.
  5. Share externally with DOWNLOAD_FILE.
  6. Retire artifacts with DETACH_FILE or DELETE_FILE when the lifecycle is complete.

Integration Relevance

  • git_action to source inputs and save binaries with SAVE_FROM_GIT.
  • project_manager_tools to keep artifacts tied to missions and todos.
  • document_index_tools to index stored files for search and Q&A.
  • artifact_manager_tools for generated outputs that later become managed files.
  • google_drive_tools to export results and then register or attach them.

Configuration Details

  • Use absolute paths for registration and ensure read or write permissions.
  • Base64 encode binary payloads for UPLOAD_FILE.
  • Choose precise MIME types for correct rendering and preview behavior.
  • Filter hierarchically when listing files to avoid noisy result sets.
  • Adopt clear filename conventions that encode purpose and entity context.

Limitations or Notes

  1. Very large files may hit upload or storage limits depending on policy.
  2. Git operations require network access and repo permissions.
  3. Entity attachments will fail if the target id is invalid.
  4. Binary corruption can occur if payloads are not base64 encoded correctly.
  5. Concurrent writes or deletes may require coordination to avoid conflicts.

Output

  • Upload and Registration: File id, metadata summary, and storage location.
  • Lists and Info: Arrays of file records with names, sizes, MIME, timestamps, and relationships.
  • Content Preview: Text segments plus pagination fields start, count, actual_count, has_more.
  • Attachments: Confirmation of attach or detach operations.
  • Git Save: Commit info, registration details, and attachment confirmation.
  • Download: Download token or path reference.
  • Errors: Descriptive messages with remediation guidance.