Skip to content

Commit dafd2f5

Browse files
authored
feat(tools): added sftp tool to accompany smtp and ssh tools (#2261)
1 parent 5af67d0 commit dafd2f5

File tree

23 files changed

+2421
-2
lines changed

23 files changed

+2421
-2
lines changed

apps/docs/components/icons.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3798,6 +3798,23 @@ export function SshIcon(props: SVGProps<SVGSVGElement>) {
37983798
)
37993799
}
38003800

3801+
export function SftpIcon(props: SVGProps<SVGSVGElement>) {
3802+
return (
3803+
<svg
3804+
{...props}
3805+
xmlns='http://www.w3.org/2000/svg'
3806+
viewBox='0 0 32 32'
3807+
width='32px'
3808+
height='32px'
3809+
>
3810+
<path
3811+
d='M 6 3 L 6 29 L 26 29 L 26 9.59375 L 25.71875 9.28125 L 19.71875 3.28125 L 19.40625 3 Z M 8 5 L 18 5 L 18 11 L 24 11 L 24 27 L 8 27 Z M 20 6.4375 L 22.5625 9 L 20 9 Z'
3812+
fill='currentColor'
3813+
/>
3814+
</svg>
3815+
)
3816+
}
3817+
38013818
export function ApifyIcon(props: SVGProps<SVGSVGElement>) {
38023819
return (
38033820
<svg

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import {
8686
SendgridIcon,
8787
SentryIcon,
8888
SerperIcon,
89+
SftpIcon,
8990
ShopifyIcon,
9091
SlackIcon,
9192
SmtpIcon,
@@ -148,6 +149,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
148149
slack: SlackIcon,
149150
shopify: ShopifyIcon,
150151
sharepoint: MicrosoftSharepointIcon,
152+
sftp: SftpIcon,
151153
serper: SerperIcon,
152154
sentry: SentryIcon,
153155
sendgrid: SendgridIcon,

apps/docs/content/docs/en/tools/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"sendgrid",
8282
"sentry",
8383
"serper",
84+
"sftp",
8485
"sharepoint",
8586
"shopify",
8687
"slack",
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
---
2+
title: SFTP
3+
description: Transfer files via SFTP (SSH File Transfer Protocol)
4+
---
5+
6+
import { BlockInfoCard } from "@/components/ui/block-info-card"
7+
8+
<BlockInfoCard
9+
type="sftp"
10+
color="#2D3748"
11+
/>
12+
13+
{/* MANUAL-CONTENT-START:intro */}
14+
[SFTP (SSH File Transfer Protocol)](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol) is a secure network protocol that enables you to upload, download, and manage files on remote servers. SFTP operates over SSH, making it ideal for automated, encrypted file transfers and remote file management within modern workflows.
15+
16+
With SFTP tools integrated into Sim, you can easily automate the movement of files between your AI agents and external systems or servers. This empowers your agents to manage critical data exchanges, backups, document generation, and remote system orchestration—all with robust security.
17+
18+
**Key functionality available via SFTP tools:**
19+
20+
- **Upload Files:** Seamlessly transfer files of any type from your workflow to a remote server, with support for both password and SSH private key authentication.
21+
- **Download Files:** Retrieve files from remote SFTP servers directly for processing, archiving, or further automation.
22+
- **List & Manage Files:** Enumerate directories, delete or create files and folders, and manage file system permissions remotely.
23+
- **Flexible Authentication:** Connect using either traditional passwords or SSH keys, with support for passphrases and permissions control.
24+
- **Large File Support:** Programmatically manage large file uploads and downloads, with built-in size limits for safety.
25+
26+
By integrating SFTP into Sim, you can automate secure file operations as part of any workflow, whether it’s data collection, reporting, remote system maintenance, or dynamic content exchange between platforms.
27+
28+
The sections below describe the key SFTP tools available:
29+
30+
- **sftp_upload:** Upload one or more files to a remote server.
31+
- **sftp_download:** Download files from a remote server to your workflow.
32+
- **sftp_list:** List directory contents on a remote SFTP server.
33+
- **sftp_delete:** Delete files or directories from a remote server.
34+
- **sftp_create:** Create new files on a remote SFTP server.
35+
- **sftp_mkdir:** Create new directories remotely.
36+
37+
See the tool documentation below for detailed input and output parameters for each operation.
38+
{/* MANUAL-CONTENT-END */}
39+
40+
41+
## Usage Instructions
42+
43+
Upload, download, list, and manage files on remote servers via SFTP. Supports both password and private key authentication for secure file transfers.
44+
45+
46+
47+
## Tools
48+
49+
### `sftp_upload`
50+
51+
Upload files to a remote SFTP server
52+
53+
#### Input
54+
55+
| Parameter | Type | Required | Description |
56+
| --------- | ---- | -------- | ----------- |
57+
| `host` | string | Yes | SFTP server hostname or IP address |
58+
| `port` | number | Yes | SFTP server port \(default: 22\) |
59+
| `username` | string | Yes | SFTP username |
60+
| `password` | string | No | Password for authentication \(if not using private key\) |
61+
| `privateKey` | string | No | Private key for authentication \(OpenSSH format\) |
62+
| `passphrase` | string | No | Passphrase for encrypted private key |
63+
| `remotePath` | string | Yes | Destination directory on the remote server |
64+
| `files` | file[] | No | Files to upload |
65+
| `fileContent` | string | No | Direct file content to upload \(for text files\) |
66+
| `fileName` | string | No | File name when using direct content |
67+
| `overwrite` | boolean | No | Whether to overwrite existing files \(default: true\) |
68+
| `permissions` | string | No | File permissions \(e.g., 0644\) |
69+
70+
#### Output
71+
72+
| Parameter | Type | Description |
73+
| --------- | ---- | ----------- |
74+
| `success` | boolean | Whether the upload was successful |
75+
| `uploadedFiles` | json | Array of uploaded file details \(name, remotePath, size\) |
76+
| `message` | string | Operation status message |
77+
78+
### `sftp_download`
79+
80+
Download a file from a remote SFTP server
81+
82+
#### Input
83+
84+
| Parameter | Type | Required | Description |
85+
| --------- | ---- | -------- | ----------- |
86+
| `host` | string | Yes | SFTP server hostname or IP address |
87+
| `port` | number | Yes | SFTP server port \(default: 22\) |
88+
| `username` | string | Yes | SFTP username |
89+
| `password` | string | No | Password for authentication \(if not using private key\) |
90+
| `privateKey` | string | No | Private key for authentication \(OpenSSH format\) |
91+
| `passphrase` | string | No | Passphrase for encrypted private key |
92+
| `remotePath` | string | Yes | Path to the file on the remote server |
93+
| `encoding` | string | No | Output encoding: utf-8 for text, base64 for binary \(default: utf-8\) |
94+
95+
#### Output
96+
97+
| Parameter | Type | Description |
98+
| --------- | ---- | ----------- |
99+
| `success` | boolean | Whether the download was successful |
100+
| `fileName` | string | Name of the downloaded file |
101+
| `content` | string | File content \(text or base64 encoded\) |
102+
| `size` | number | File size in bytes |
103+
| `encoding` | string | Content encoding \(utf-8 or base64\) |
104+
| `message` | string | Operation status message |
105+
106+
### `sftp_list`
107+
108+
List files and directories on a remote SFTP server
109+
110+
#### Input
111+
112+
| Parameter | Type | Required | Description |
113+
| --------- | ---- | -------- | ----------- |
114+
| `host` | string | Yes | SFTP server hostname or IP address |
115+
| `port` | number | Yes | SFTP server port \(default: 22\) |
116+
| `username` | string | Yes | SFTP username |
117+
| `password` | string | No | Password for authentication \(if not using private key\) |
118+
| `privateKey` | string | No | Private key for authentication \(OpenSSH format\) |
119+
| `passphrase` | string | No | Passphrase for encrypted private key |
120+
| `remotePath` | string | Yes | Directory path on the remote server |
121+
| `detailed` | boolean | No | Include detailed file information \(size, permissions, modified date\) |
122+
123+
#### Output
124+
125+
| Parameter | Type | Description |
126+
| --------- | ---- | ----------- |
127+
| `success` | boolean | Whether the operation was successful |
128+
| `path` | string | Directory path that was listed |
129+
| `entries` | json | Array of directory entries with name, type, size, permissions, modifiedAt |
130+
| `count` | number | Number of entries in the directory |
131+
| `message` | string | Operation status message |
132+
133+
### `sftp_delete`
134+
135+
Delete a file or directory on a remote SFTP server
136+
137+
#### Input
138+
139+
| Parameter | Type | Required | Description |
140+
| --------- | ---- | -------- | ----------- |
141+
| `host` | string | Yes | SFTP server hostname or IP address |
142+
| `port` | number | Yes | SFTP server port \(default: 22\) |
143+
| `username` | string | Yes | SFTP username |
144+
| `password` | string | No | Password for authentication \(if not using private key\) |
145+
| `privateKey` | string | No | Private key for authentication \(OpenSSH format\) |
146+
| `passphrase` | string | No | Passphrase for encrypted private key |
147+
| `remotePath` | string | Yes | Path to the file or directory to delete |
148+
| `recursive` | boolean | No | Delete directories recursively |
149+
150+
#### Output
151+
152+
| Parameter | Type | Description |
153+
| --------- | ---- | ----------- |
154+
| `success` | boolean | Whether the deletion was successful |
155+
| `deletedPath` | string | Path that was deleted |
156+
| `message` | string | Operation status message |
157+
158+
### `sftp_mkdir`
159+
160+
Create a directory on a remote SFTP server
161+
162+
#### Input
163+
164+
| Parameter | Type | Required | Description |
165+
| --------- | ---- | -------- | ----------- |
166+
| `host` | string | Yes | SFTP server hostname or IP address |
167+
| `port` | number | Yes | SFTP server port \(default: 22\) |
168+
| `username` | string | Yes | SFTP username |
169+
| `password` | string | No | Password for authentication \(if not using private key\) |
170+
| `privateKey` | string | No | Private key for authentication \(OpenSSH format\) |
171+
| `passphrase` | string | No | Passphrase for encrypted private key |
172+
| `remotePath` | string | Yes | Path for the new directory |
173+
| `recursive` | boolean | No | Create parent directories if they do not exist |
174+
175+
#### Output
176+
177+
| Parameter | Type | Description |
178+
| --------- | ---- | ----------- |
179+
| `success` | boolean | Whether the directory was created successfully |
180+
| `createdPath` | string | Path of the created directory |
181+
| `message` | string | Operation status message |
182+
183+
184+
185+
## Notes
186+
187+
- Category: `tools`
188+
- Type: `sftp`

apps/docs/content/docs/en/tools/smtp.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
77

88
<BlockInfoCard
99
type="smtp"
10-
color="#4A5568"
10+
color="#2D3748"
1111
/>
1212

1313
{/* MANUAL-CONTENT-START:intro */}

0 commit comments

Comments
 (0)