@superglue/cli 1.1.31 → 1.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +13 -8
- package/dist/cli.js +278 -380
- package/dist/skills/superglue/SKILL.md +39 -38
- package/dist/skills/superglue/references/file-handling.md +9 -6
- package/dist/skills/superglue/references/http.md +15 -4
- package/dist/skills/superglue/references/mongodb.md +136 -0
- package/dist/skills/superglue/references/mssql.md +22 -22
- package/dist/skills/superglue/references/odbc.md +2 -2
- package/dist/skills/superglue/references/postgres.md +2 -2
- package/dist/skills/superglue/references/redis.md +2 -2
- package/dist/skills/superglue/references/sftp-smb.md +5 -5
- package/dist/skills/superglue/references/superglue-info.md +25 -12
- package/package.json +1 -1
- package/skills/superglue/SKILL.md +39 -38
- package/skills/superglue/references/file-handling.md +9 -6
- package/skills/superglue/references/http.md +15 -4
- package/skills/superglue/references/mongodb.md +136 -0
- package/skills/superglue/references/mssql.md +22 -22
- package/skills/superglue/references/odbc.md +2 -2
- package/skills/superglue/references/postgres.md +2 -2
- package/skills/superglue/references/redis.md +2 -2
- package/skills/superglue/references/sftp-smb.md +5 -5
- package/skills/superglue/references/superglue-info.md +25 -12
|
@@ -13,7 +13,7 @@ FTP, SFTP, and SMB share an identical operation interface. Only the URL protocol
|
|
|
13
13
|
}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Configure the connection URL based on
|
|
16
|
+
Configure the connection URL based on the selected credential's secrets — use `sg system find` to inspect the available secret names and reference them accordingly.
|
|
17
17
|
|
|
18
18
|
`method`, `headers`, `queryParams`, and `pagination` are HTTP-only fields — omit them for file server steps.
|
|
19
19
|
|
|
@@ -128,7 +128,7 @@ Single operation returns the result directly. Array of operations returns an arr
|
|
|
128
128
|
|
|
129
129
|
**FTP/FTPS:** uses `basic-ftp`. FTPS uses TLS with `rejectUnauthorized: false`. Connection timeout configurable.
|
|
130
130
|
|
|
131
|
-
**SMB:** uses `@tryjsky/v9u-smb2`. Connection lifecycle: create client (with share, domain, credentials), execute operations, disconnect.
|
|
131
|
+
**SMB:** uses `@tryjsky/v9u-smb2`. Connection lifecycle: create client (with share, domain, credentials), execute operations, disconnect.
|
|
132
132
|
|
|
133
133
|
### Retry Behavior
|
|
134
134
|
|
|
@@ -152,10 +152,10 @@ When the user wants to **download** a file fetched via SFTP/SMB/FTP, set `output
|
|
|
152
152
|
When a file server step fails and the cause is not obvious:
|
|
153
153
|
|
|
154
154
|
1. **Read the error message** — superglue includes the operations list in the error. Check for typos in paths, missing fields, or unsupported operations.
|
|
155
|
-
2. **Verify connection
|
|
155
|
+
2. **Verify connection secrets** — use `sg system find` to confirm the stored secret names match the placeholders in your URL. Test with a simple `list` operation on the base path via `sg system call`.
|
|
156
156
|
3. **Check path resolution** — if you get "file not found", verify the path is relative to the URL base path, not an absolute filesystem path. Use `list` on the parent directory to see what files exist.
|
|
157
157
|
4. **Check permissions** — permission denied errors mean the user account lacks read/write access to the target path. Verify with the user that the account has the required grants.
|
|
158
158
|
5. **Check protocol-specific issues:**
|
|
159
|
-
- **SFTP**: if the error mentions authentication, verify whether the server expects password or private key auth. If using private key, ensure `privateKey` and `passphrase` are stored as
|
|
159
|
+
- **SFTP**: if the error mentions authentication, verify whether the server expects password or private key auth. If using private key, ensure `privateKey` and `passphrase` are stored as secrets in the credential.
|
|
160
160
|
- **FTP/FTPS**: if the connection fails, try switching between `ftp://` and `ftps://` — some servers require TLS, others don't support it.
|
|
161
|
-
- **SMB**: verify the share name is correct (first path segment). If using domain auth, ensure the domain is included in the URL or stored as a
|
|
161
|
+
- **SMB**: verify the share name is correct (first path segment). If using domain auth, ensure the domain is included in the URL or stored as a secret. Check that the SMB port (445) is accessible.
|
|
@@ -7,18 +7,26 @@ superglue is an open-source, AI-native integration platform that builds and runs
|
|
|
7
7
|
Developed by superglue (Y Combinator W25), founded by Adina Görres and Stefan Faistenauer in 2025, based in Munich and San Francisco.
|
|
8
8
|
|
|
9
9
|
- Website: https://superglue.ai
|
|
10
|
-
- Documentation: https://
|
|
10
|
+
- Documentation: https://superglue.ai/docs/
|
|
11
11
|
- GitHub: https://github.com/superglue-ai/superglue
|
|
12
12
|
|
|
13
13
|
If the user is asking general questions (not building):
|
|
14
14
|
|
|
15
15
|
- Company/team/pricing → https://superglue.ai/
|
|
16
|
-
- Product/features → https://
|
|
16
|
+
- Product/features → https://superglue.ai/docs/getting-started/introduction/
|
|
17
17
|
- Open-source/code → https://github.com/superglue-ai/superglue
|
|
18
18
|
|
|
19
|
+
## Cloud Usage Tiers
|
|
20
|
+
|
|
21
|
+
- Cloud tiers are **Trial**, **Pro**, **Team**, and **Enterprise**; billing-enabled apps expose upgrades through the in-app **Upgrade Plan** button, not a separate Billing page.
|
|
22
|
+
- **Trial** includes 1M input tokens and 100 runs lifetime; **Pro** is €59/$69 per month with 3M input tokens/user/month and 3,000 runs/user/month.
|
|
23
|
+
- **Team** is €99/$119 per seat/month with 5M input tokens/user/month and 5,000 runs/user/month; Team includes organization management, activity tracking, and custom MCP servers.
|
|
24
|
+
- **Enterprise** is custom-priced with unlimited usage limits by default, enterprise access controls, and self-hosting/on-prem options.
|
|
25
|
+
- These cloud tier details do not apply to self-hosted or enterprise deployment setups.
|
|
26
|
+
|
|
19
27
|
## Authentication
|
|
20
28
|
|
|
21
|
-
API, SDK,
|
|
29
|
+
API, SDK, and webhook usage require an **API key**. The CLI should use browser OAuth via `sg login`; headless/API-key CLI auth is available through environment variables, flags, or `config.json` for CI and legacy automation. MCP clients can use OAuth when supported, or API keys for non-interactive setup. Self-hosted deployments also need the API/MCP endpoint URL. There are no workspace IDs, project IDs, or other identifiers.
|
|
22
30
|
|
|
23
31
|
MCP authentication is separate from API/SDK/CLI setup. For MCP OAuth, dynamic client registration, Langdock setup, and named server permissions, use the MCP documentation.
|
|
24
32
|
|
|
@@ -27,10 +35,10 @@ Users can generate and manage API keys on the standalone **API Keys** page (`/ap
|
|
|
27
35
|
## Interfaces
|
|
28
36
|
|
|
29
37
|
- **Web app** — primary UI for building, testing, and managing tools and systems
|
|
30
|
-
- **TypeScript/Python SDK** — https://
|
|
31
|
-
- **REST API** — https://
|
|
32
|
-
- **MCP Server** — https://
|
|
33
|
-
- **CLI** — `npm install -g @superglue/cli` — https://
|
|
38
|
+
- **TypeScript/Python SDK** — https://superglue.ai/docs/sdk/overview/
|
|
39
|
+
- **REST API** — https://superglue.ai/docs/api/
|
|
40
|
+
- **MCP Server** — https://superglue.ai/docs/mcp/using-the-mcp/
|
|
41
|
+
- **CLI** — `npm install -g @superglue/cli` — https://superglue.ai/docs/getting-started/cli-skills/
|
|
34
42
|
|
|
35
43
|
### Webhook Triggers
|
|
36
44
|
|
|
@@ -44,6 +52,10 @@ OAuth flows require a callback URL: `{appEndpoint}/api/auth/callback`
|
|
|
44
52
|
|
|
45
53
|
On superglue Cloud, the app endpoint is `https://app.superglue.cloud`. Self-hosted and enterprise deployments use their own app URL. If a user doesn't know their endpoints, they can check the browser URL bar for the app endpoint and deployment configuration for the API endpoint.
|
|
46
54
|
|
|
55
|
+
### Cloud Networking
|
|
56
|
+
|
|
57
|
+
If a customer's system requires IP allowlisting for firewall rules, security groups, or vendor access controls, superglue Cloud outbound requests come from `34.234.12.178` and `18.198.191.215`. These IPs apply to superglue Cloud only; self-hosted and enterprise deployments use deployment-specific networking.
|
|
58
|
+
|
|
47
59
|
## Web App UI Layout
|
|
48
60
|
|
|
49
61
|
Use this section as the source of truth for high-level web app navigation. Do not invent UI locations that are not listed here.
|
|
@@ -53,7 +65,7 @@ The persistent left sidebar contains these top-level items:
|
|
|
53
65
|
- **Agent** (`/`) — primary AI chat assistant for building and debugging tools and systems.
|
|
54
66
|
- **Tools** (`/tools`, detail at `/tools/{toolId}`) — saved tools; opens the tool playground for editing, testing, and running.
|
|
55
67
|
- **Systems** (`/systems`, detail at `/systems/{systemId}`) — connected external systems with credentials and documentation.
|
|
56
|
-
- **
|
|
68
|
+
- **Credentials** (`/credentials`) — manage the credentials you own for each system, and the credentials shared with you. Admins and members open it inside the normal app shell from the sidebar. API keys are not managed here.
|
|
57
69
|
- **Runs** (`/runs`, detail at `/runs/{runId}`) — execution history for full, draft, and single-step tool runs. Runs is a top-level sidebar item, not a Control Panel sub-item.
|
|
58
70
|
- **Control Panel** (`/admin`) — expandable group for organization and account administration:
|
|
59
71
|
- **Overview** (`/admin`) — dashboard summary, including failed-run and schedule summaries.
|
|
@@ -63,9 +75,9 @@ The persistent left sidebar contains these top-level items:
|
|
|
63
75
|
- **Organization** (`/organization`) — visible on paid tiers as a standalone page without tabs. It shows members, invitations, role assignment, and member-management actions; management actions are admin-gated.
|
|
64
76
|
- **MCP Servers** (`/admin?view=mcp-servers`) — manage and export named MCP server endpoints. Use the MCP documentation for behavior, permissions, and client setup.
|
|
65
77
|
|
|
66
|
-
Below the navigation, the sidebar shows the current organization menu. Opening it shows the signed-in user email and menu items for **API Keys** (`/api-keys`), **Settings** (`/settings`, admin-only), **Switch organization**, and **Sign Out**.
|
|
78
|
+
Below the navigation, the sidebar shows the current organization menu. Opening it shows the signed-in user email and menu items for **API Keys** (`/api-keys`), **Settings** (`/settings`, admin-only), **Switch organization**, and **Sign Out**. When billing is enabled, the sidebar also shows **Upgrade Plan** for non-enterprise organizations; it opens the in-app upgrade flow. There is no separate in-app Billing page.
|
|
67
79
|
|
|
68
|
-
**API Keys** (`/api-keys`) is a standalone page with a simple own-key editor for superglue API keys used by API, SDK, CLI, webhook, and non-OAuth MCP clients. Org users can create, copy, and delete their own keys.
|
|
80
|
+
**API Keys** (`/api-keys`) is a standalone page with a simple own-key editor for superglue API keys used by API, SDK, CLI headless/API-key auth, webhook, and non-OAuth MCP clients. Org users can create, copy, and delete their own keys.
|
|
69
81
|
|
|
70
82
|
**Settings** (`/settings`) is an admin-only standalone page with distinct sections:
|
|
71
83
|
|
|
@@ -98,7 +110,8 @@ Steps are routed to execution strategies by protocol (first match wins):
|
|
|
98
110
|
3. PostgreSQL → URL starts with `postgres://` or `postgresql://`
|
|
99
111
|
4. MSSQL/Azure SQL → URL starts with `mssql://` or `sqlserver://`
|
|
100
112
|
5. Redis → URL starts with `redis://` or `rediss://`
|
|
101
|
-
6.
|
|
102
|
-
7.
|
|
113
|
+
6. MongoDB → URL starts with `mongodb://` or `mongodb+srv://`
|
|
114
|
+
7. FTP/SFTP → URL starts with `ftp://`, `ftps://`, or `sftp://`
|
|
115
|
+
8. SMB → URL starts with `smb://`
|
|
103
116
|
|
|
104
117
|
All user-provided JS (data selectors, transforms, stop conditions) runs in an isolated Deno sandbox.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: superglue
|
|
3
|
-
description: "Build, test, deploy and integrate superglue tools via the sg CLI and superglue SDKs. IMPORTANT — you MUST invoke this skill and read the full reference BEFORE running ANY sg command or writing ANY superglue SDK/REST/webhook integration code. Before using the sg CLI, first check that it is installed (run sg --version; if not found, install with npm install -g @superglue/cli), then verify it is configured
|
|
3
|
+
description: "Build, test, deploy and integrate superglue tools via the sg CLI and superglue SDKs. IMPORTANT — you MUST invoke this skill and read the full reference BEFORE running ANY sg command or writing ANY superglue SDK/REST/webhook integration code. Before using the sg CLI, first check that it is installed (run sg --version; if not found, install with npm install -g @superglue/cli), then verify either that it is configured with sg login or, for headless/API-key auth, that SUPERGLUE_API_KEY and SUPERGLUE_API_ENDPOINT environment variables are set. If not, guide the user through setup first. After reading SKILL.md, also run `sg skill <topic>` for the specific protocols and topics involved."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# superglue CLI (`sg`) — Agent Reference
|
|
@@ -23,6 +23,7 @@ Read these on demand — they are authoritative for their topic and kept in sync
|
|
|
23
23
|
| `sg skill mssql` | MSSQL / Azure SQL connection URLs, schema introspection, parameterized queries |
|
|
24
24
|
| `sg skill odbc` | ODBC connections (SAP ASE / Sybase via FreeTDS), driver config, positional `?` params |
|
|
25
25
|
| `sg skill redis` | Redis command syntax, connection URLs, key type handling |
|
|
26
|
+
| `sg skill mongodb` | MongoDB connection URLs (mongodb:// / mongodb+srv://), CRUD operations, Extended JSON, aggregation |
|
|
26
27
|
| `sg skill sftp-smb` | SFTP, FTP, and SMB operations, file upload/download semantics, path handling |
|
|
27
28
|
| `sg skill file-handling` | File detection, parsing, `file::` reference syntax, lazy base64 access, transform-produced files |
|
|
28
29
|
| `sg skill access-rules` | RBAC roles, resource grants, and tool/system permissions (enterprise only) |
|
|
@@ -33,7 +34,7 @@ Read these on demand — they are authoritative for their topic and kept in sync
|
|
|
33
34
|
|
|
34
35
|
1. **Check CLI exists**: Run `sg --version`. If it fails with `command not found`, install: `npm install -g @superglue/cli`.
|
|
35
36
|
2. **Keep CLI and SDK up to date**: Always use the latest versions. Run `sg update` to update the CLI. For the SDK, run `npm install @superglue/client@latest` (JS) or `pip install --upgrade superglue-client` (Python).
|
|
36
|
-
3. **Verify configuration**: Run `sg system list`. If it fails with `fetch failed` or auth errors, the CLI needs configuration via `sg
|
|
37
|
+
3. **Verify configuration**: Run `sg whoami` or `sg system list`. If it fails with `fetch failed` or auth errors, the CLI needs configuration via `sg login` (see Setup below). For custom/self-hosted instances, the CLI must know the instance API endpoint; browser login also needs the web app endpoint when it differs from the API URL. Use API-key auth only for headless/legacy environments.
|
|
37
38
|
|
|
38
39
|
**Calling systems and running tools**
|
|
39
40
|
|
|
@@ -53,7 +54,7 @@ Read these on demand — they are authoritative for their topic and kept in sync
|
|
|
53
54
|
|
|
54
55
|
**Non-interactive environments (AI agents, CI)**
|
|
55
56
|
|
|
56
|
-
- Pass
|
|
57
|
+
- Pass all secret values directly via `--credentials '{"api_key":"sk-xxx"}'`. Ask the user for secret values, then include them in the JSON.
|
|
57
58
|
|
|
58
59
|
---
|
|
59
60
|
|
|
@@ -67,26 +68,22 @@ npm install -g @superglue/cli
|
|
|
67
68
|
|
|
68
69
|
After installation the `sg` command is available globally.
|
|
69
70
|
|
|
70
|
-
###
|
|
71
|
+
### Authentication
|
|
71
72
|
|
|
72
|
-
The CLI
|
|
73
|
+
The preferred CLI setup is browser OAuth via `sg login`. Headless/API-key auth is available for CI and legacy automation. The API endpoint defaults to `https://api.superglue.cloud`.
|
|
73
74
|
|
|
74
|
-
**
|
|
75
|
+
**Browser login (humans):**
|
|
75
76
|
|
|
76
77
|
```bash
|
|
77
|
-
sg
|
|
78
|
+
sg login
|
|
79
|
+
sg --endpoint "https://custom-api.example.com" login --web-endpoint "https://custom-app.example.com" --save-config
|
|
78
80
|
```
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
Opens the browser, completes OAuth login, and stores the OAuth session in `~/.superglue/auth.json`. This file is separate from `config.json`. Use `--save-config` to persist non-secret endpoint settings in `config.json`, and `sg logout` to remove the OAuth session.
|
|
81
83
|
|
|
82
|
-
**
|
|
84
|
+
**Headless/API-key auth (CI, agents, backwards-compatible):**
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
sg init --api-key "your-api-key" --global
|
|
86
|
-
sg init --api-key "your-api-key" --endpoint "https://custom.endpoint.com" --global
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
`--api-key` and `--endpoint` are global flags and work on all subcommands.
|
|
86
|
+
Use environment variables, global flags, or an existing `.superglue/config.json`. `sg init` remains available as a legacy hidden command for scripts that already use it, but new setup should prefer `sg login` for humans and env vars/config files for headless API-key auth.
|
|
90
87
|
|
|
91
88
|
**Environment variables (no config file):**
|
|
92
89
|
|
|
@@ -95,13 +92,13 @@ export SUPERGLUE_API_KEY="your-api-key"
|
|
|
95
92
|
export SUPERGLUE_API_ENDPOINT="https://api.superglue.cloud" # optional, this is the default
|
|
96
93
|
```
|
|
97
94
|
|
|
98
|
-
**Config resolution order:** CLI flags > environment variables > local `.superglue/config.json` > global `~/.superglue/config.json`.
|
|
95
|
+
**Config resolution order:** CLI flags > environment variables > local `.superglue/config.json` > global `~/.superglue/config.json`. For authentication, API keys from flags/env/config take precedence; if no API key is configured, the CLI uses the matching OAuth session from `~/.superglue/auth.json`.
|
|
99
96
|
|
|
100
|
-
Verify with `sg system list` — should return
|
|
97
|
+
Verify with `sg whoami` or `sg system list` — should return authenticated context without errors.
|
|
101
98
|
|
|
102
99
|
### Capability Presets
|
|
103
100
|
|
|
104
|
-
Set
|
|
101
|
+
Set via `SUPERGLUE_CLI_PRESET` env var or `config.json` as `"preset"`. Legacy `sg init --preset` still writes this value for existing scripts.
|
|
105
102
|
|
|
106
103
|
| Preset | Description |
|
|
107
104
|
| --------- | ---------------------------------------------------------------------------------------------- |
|
|
@@ -127,7 +124,7 @@ Blocked commands print a clear error showing the current preset and how to chang
|
|
|
127
124
|
### Building a Tool
|
|
128
125
|
|
|
129
126
|
1. **Load relevant protocol references** via `sg skill <topic>` based on the systems involved (http, postgres, graphql, etc.)
|
|
130
|
-
2. Use `sg system find` for every involved system — note
|
|
127
|
+
2. Use `sg system find` for every involved system — note the available secret names and the system URL
|
|
131
128
|
3. Use `sg system search-docs` for each system — look up endpoints, auth patterns, pagination, response structure
|
|
132
129
|
4. Use `sg system call` to test 1-2 primary endpoints — verify response structure and field names before building
|
|
133
130
|
5. Call `sg tool build --config '{...}'` with the full tool config (see Reference → Tool Config Schema)
|
|
@@ -148,7 +145,7 @@ Blocked commands print a clear error showing the current preset and how to chang
|
|
|
148
145
|
1. Search for an existing system first: `sg system find <query>`
|
|
149
146
|
2. If creating: `sg system create --name "..." --url "..." --credentials '{...}'`. Prefer `--template <id>` when one exists — it auto-fills URL and OAuth config
|
|
150
147
|
3. For OAuth: `sg system oauth --system-id <id> [--scopes "..."]` opens a browser flow. User approves → tokens saved automatically
|
|
151
|
-
4. For
|
|
148
|
+
4. For non-OAuth secrets: `sg system credentials set --system-id <id> --credentials '{...}'`
|
|
152
149
|
5. Verify connectivity with `sg system call`
|
|
153
150
|
6. For updates: `sg system edit --id <id>` with the fields to change
|
|
154
151
|
|
|
@@ -222,8 +219,8 @@ Agents familiar with the web tool names can map them directly to CLI commands:
|
|
|
222
219
|
| `run_command` with `vfs` for `/org/tools/` | `sg tool find --id <id>` / `sg tool find <q>` | Full config with `--id`, compact search with a query string |
|
|
223
220
|
| `create_system` | `sg system create --name "..." --url "..."` | Use `--template <id>` when available |
|
|
224
221
|
| `edit_system` | `sg system edit --id <id> ...` | Supports `--env dev\|prod` |
|
|
225
|
-
| `run_command` with `vfs` for `/org/systems/` | `sg system find <query>` / `--id <id>` | Returns
|
|
226
|
-
| Credentials VFS /
|
|
222
|
+
| `run_command` with `vfs` for `/org/systems/` | `sg system find <query>` / `--id <id>` | Returns secret-key presence and the system URL |
|
|
223
|
+
| Credentials VFS / saved credentials | `sg system credentials get/set/clear` | Manage the current user's credentials for a system |
|
|
227
224
|
| `call_system` | `sg system call --url "..." --system-id <id>` | Authenticated ad-hoc calls for testing / schema introspection |
|
|
228
225
|
| `run_command search` | `sg system search-docs --system-id <id> -k` | Targeted keyword search over ingested system docs |
|
|
229
226
|
| `authenticate_oauth` | `sg system oauth --system-id <id> [--scopes]` | Opens browser flow. Supports `--grant-type client_credentials` too |
|
|
@@ -233,13 +230,17 @@ Agents familiar with the web tool names can map them directly to CLI commands:
|
|
|
233
230
|
| `edit_mcp_server` | `sg mcp edit --id <id> ...` | Edits name, auth mode, description, or selected tool IDs |
|
|
234
231
|
| `create_schedule` | `sg schedule create --tool <id> --cron <expr>` | Creates a cron schedule for a saved tool |
|
|
235
232
|
| `edit_schedule` | `sg schedule edit --tool <id> --id <schedule>` | Updates, enables, or disables an existing schedule |
|
|
236
|
-
| (no direct equivalent) | `sg
|
|
233
|
+
| (no direct equivalent) | `sg login`, `sg update`, `sg skill` | CLI-specific setup, updater, and this reference system |
|
|
237
234
|
|
|
238
235
|
Web-agent-only concepts with no CLI equivalent: `run_command`'s virtual filesystem (CLI uses concrete `sg` subcommands), `authenticate_oauth`'s dedicated MCP `authenticate` tool (CLI uses `sg system oauth`).
|
|
239
236
|
|
|
240
237
|
### Command Reference
|
|
241
238
|
|
|
242
|
-
**`sg
|
|
239
|
+
**`sg login`** — Browser OAuth setup. Stores the OAuth session in `~/.superglue/auth.json`. Flags: `--web-endpoint`, `--no-browser`, `--save-config`, `--global`. Use global `--endpoint` for custom/self-hosted API URLs.
|
|
240
|
+
|
|
241
|
+
**`sg logout`** — Removes the stored OAuth session from `~/.superglue/auth.json`.
|
|
242
|
+
|
|
243
|
+
**`sg whoami`** — Shows the authenticated superglue user and organization.
|
|
243
244
|
|
|
244
245
|
**Tool commands:**
|
|
245
246
|
|
|
@@ -335,7 +336,7 @@ Attach files with repeatable `--file key=path`. Reference in payloads with `file
|
|
|
335
336
|
}
|
|
336
337
|
```
|
|
337
338
|
|
|
338
|
-
**Request step fields** (HTTP, Postgres, MSSQL, Redis, FTP/SFTP, SMB) — see protocol-specific references for full details:
|
|
339
|
+
**Request step fields** (HTTP, Postgres, MSSQL, Redis, MongoDB, FTP/SFTP, SMB) — see protocol-specific references for full details:
|
|
339
340
|
|
|
340
341
|
| Field | Type | Description |
|
|
341
342
|
| ------------- | ------ | ------------------------------------------------------------------------ |
|
|
@@ -377,7 +378,8 @@ All step config fields (url, headers, body, queryParams) support `<<expression>>
|
|
|
377
378
|
<<page>> <<offset>> <<cursor>> <<limit>> <<pageSize>> pagination variables
|
|
378
379
|
<<systemId_api_key>> system credentials (namespaced: systemId_credKey)
|
|
379
380
|
<<systemId_url>> system base URLs (namespaced: systemId_url)
|
|
380
|
-
<<sg_auth_email>> email of the
|
|
381
|
+
<<sg_auth_email>> email of the user triggering this run (in scheduled runs: the schedule creator)
|
|
382
|
+
<<sg_auth_jwt>> short-lived signed JWT proving the identity of the user triggering this run; receivers verify it against superglue's outbound JWKS endpoint (/api/auth/outbound-jwks on the web app origin)
|
|
381
383
|
```
|
|
382
384
|
|
|
383
385
|
Simple `<<varName>>` only works for top-level keys. No dots, no nesting. `<<currentItem.id>>`, `<<sourceData.userId>>`, `<<user.name>>` all FAIL at runtime.
|
|
@@ -422,7 +424,7 @@ sourceData = {
|
|
|
422
424
|
|
|
423
425
|
Everything in `sourceData` shares ONE flat namespace. Saving a tool rejects payload input keys and step ids that collide with it:
|
|
424
426
|
|
|
425
|
-
- `__files__`, `currentItem`, `sg_auth_email` — injected by the runtime
|
|
427
|
+
- `__files__`, `currentItem`, `sg_auth_email`, `sg_auth_jwt` — injected by the runtime
|
|
426
428
|
- `page`, `offset`, `cursor`, `limit`, `pageSize` — rejected only when the tool has a paginated step, because they would shadow the live pagination counters; on non-paginated tools they are allowed but discouraged (a later edit that adds pagination will force a rename)
|
|
427
429
|
- the tool's own step ids — the step result overwrites a same-named payload key
|
|
428
430
|
- anything starting with `<systemId>_` for a system the tool uses — the entire prefix is reserved for namespaced credentials (`<systemId>_<credKey>`, `<systemId>_url`), even names that don't match an existing credential, because credentials added to the system later would silently shadow the input
|
|
@@ -490,10 +492,10 @@ All user-provided JS runs in an isolated Deno sandbox.
|
|
|
490
492
|
|
|
491
493
|
### Credentials and Systems
|
|
492
494
|
|
|
493
|
-
|
|
495
|
+
Secrets are referenced by name as `<<systemId_credentialKey>>` and resolved from the selected credential at execution time. You MUST explicitly reference them:
|
|
494
496
|
|
|
495
497
|
```
|
|
496
|
-
System id="stripe",
|
|
498
|
+
System id="stripe", selected credential has secret named: api_key
|
|
497
499
|
→ Available as: <<stripe_api_key>>
|
|
498
500
|
```
|
|
499
501
|
|
|
@@ -516,11 +518,11 @@ Basic auth auto-encodes: if the value after `Basic ` isn't already base64, the e
|
|
|
516
518
|
|
|
517
519
|
**Credential lifecycle:**
|
|
518
520
|
|
|
519
|
-
- Pass
|
|
520
|
-
-
|
|
521
|
-
- Use `sg system credentials get --system-id <id>` to inspect current
|
|
521
|
+
- Pass all secret values via `--credentials '{"api_key":"...","client_secret":"..."}'` on create/edit
|
|
522
|
+
- Use `sg system credentials set --system-id <id> --credentials '{...}'` to save secrets in the current API-key user's credential
|
|
523
|
+
- Use `sg system credentials get --system-id <id>` to inspect the current user's secret names and whether each has a non-empty value; secret values are never returned
|
|
522
524
|
- OAuth tokens (`access_token`, `refresh_token`) auto-refresh before each step execution
|
|
523
|
-
- Non-sensitive fields (`client_id`, `auth_url`, `token_url`)
|
|
525
|
+
- Non-sensitive fields (`client_id`, `auth_url`, `token_url`) can be submitted alongside secrets in the same `--credentials` JSON
|
|
524
526
|
|
|
525
527
|
**System IDs:** lowercase letters, numbers, underscores only — no hyphens. Used for credential namespacing.
|
|
526
528
|
|
|
@@ -586,7 +588,7 @@ Drafts live under the active CLI config directory: local `.superglue/drafts/` wh
|
|
|
586
588
|
|
|
587
589
|
After building and saving, tools can be invoked from code via REST API, SDK, or webhook. See `sg skill integration` for complete SDK (TypeScript/Python), REST API, and webhook examples including retry patterns.
|
|
588
590
|
|
|
589
|
-
**IP whitelisting:** if a customer's system requires IP whitelisting
|
|
591
|
+
**IP whitelisting:** if a customer's system requires IP whitelisting for firewall rules, security groups, or vendor access controls, superglue Cloud outbound requests come from `34.234.12.178` and `18.198.191.215`. These IPs apply to superglue Cloud only; self-hosted and enterprise deployments use deployment-specific networking.
|
|
590
592
|
|
|
591
593
|
Quick reference:
|
|
592
594
|
|
|
@@ -622,14 +624,13 @@ curl -X POST "https://api.superglue.cloud/v1/hooks/{toolId}?token=$SUPERGLUE_API
|
|
|
622
624
|
- **Double-encoded JSON** — when the body contains nested/stringified JSON (e.g. LLM APIs), have `<<>>` expressions return a string via `JSON.stringify(...)`, and use a single expression for the whole body rather than mixing `<<>>` with static JSON
|
|
623
625
|
- **POST for read-only ops** — GraphQL queries via POST should have `modify: false`. Don't rely on HTTP method alone
|
|
624
626
|
- **Saving without approval** — always present `sg tool run` results and ask before `sg tool save`
|
|
625
|
-
- **`sg_auth_email` in scheduled runs** — not available in scheduler-triggered executions. Tools using `<<sg_auth_email>>` will fail
|
|
626
627
|
- **Reserved key collisions** — payload inputs or step ids named after reserved/injected keys (see Naming Rules) are rejected at save time; pick a different name instead of retrying
|
|
627
628
|
|
|
628
629
|
---
|
|
629
630
|
|
|
630
631
|
## Error Recovery
|
|
631
632
|
|
|
632
|
-
For protocol-specific error recovery (HTTP, Postgres, MSSQL, Redis, GraphQL, SFTP/SMB), run `sg skill <protocol>`. General strategies below.
|
|
633
|
+
For protocol-specific error recovery (HTTP, Postgres, MSSQL, Redis, MongoDB, GraphQL, SFTP/SMB), run `sg skill <protocol>`. General strategies below.
|
|
633
634
|
|
|
634
635
|
### Tool build fails validation
|
|
635
636
|
|
|
@@ -639,14 +640,14 @@ For protocol-specific error recovery (HTTP, Postgres, MSSQL, Redis, GraphQL, SFT
|
|
|
639
640
|
|
|
640
641
|
1. Re-run with `--include-step-results` to see raw per-step responses and `data` fields
|
|
641
642
|
2. Use `sg system call` to test the failing endpoint directly — isolates step config vs system/auth issues
|
|
642
|
-
3. Use `sg system find --id <systemId>` to verify
|
|
643
|
+
3. Use `sg system find --id <systemId>` to verify the stored secret names match what the step references
|
|
643
644
|
4. For HTTP: run `sg skill http` and follow the error recovery section (endpoint vs system isolation, credential scopes, rate limiting)
|
|
644
645
|
5. For databases: run `sg skill postgres` or `sg skill mssql` — SSL/TLS and schema issues are common causes
|
|
645
646
|
6. Use `sg system search-docs` and web search to verify the current API shape. APIs change across versions
|
|
646
647
|
|
|
647
648
|
### Authentication failures
|
|
648
649
|
|
|
649
|
-
1. Run `sg system find --id <systemId>` → check
|
|
650
|
+
1. Run `sg system find --id <systemId>` → check which secret names are present and whether they have non-empty values
|
|
650
651
|
2. For OAuth: re-run `sg system oauth` if tokens are missing or expired
|
|
651
652
|
3. For custom OAuth: verify `client_id`, `client_secret`, `auth_url`, `token_url` are all present. Confirm the redirect URI is registered on the provider's OAuth app
|
|
652
653
|
4. Check scopes — 403 / empty responses often mean the token lacks required scopes
|
|
@@ -44,7 +44,7 @@ N/A — file handling is a runtime behavior, not a protocol. Authentication is h
|
|
|
44
44
|
|
|
45
45
|
Every response is read as raw bytes. The runtime classifies it using this priority chain:
|
|
46
46
|
|
|
47
|
-
1. **Magic-byte detection** — known binary signatures (ZIP `PK\x03\x04`, PDF `%PDF`, GZIP `\x1f\x8b`, plus internal ZIP structure checks for Excel/DOCX)
|
|
47
|
+
1. **Magic-byte detection** — known binary signatures (ZIP `PK\x03\x04`, PDF `%PDF`, GZIP `\x1f\x8b`, plus internal ZIP structure checks for Excel/DOCX/PPTX)
|
|
48
48
|
2. **`Content-Disposition: attachment`** — `attachment` or `filename=` in this header forces file treatment
|
|
49
49
|
3. **`application/octet-stream`** — explicit octet-stream MIME catches unlabeled binary payloads
|
|
50
50
|
4. **25MB size fallback** — only when byte detection returned `RAW`, the response exceeds 25MB, and `Content-Type` is not text-like (`text/*`, `application/json`, `*+json`, `application/xml`)
|
|
@@ -53,11 +53,11 @@ File server `get` operations always produce files regardless of detected type.
|
|
|
53
53
|
|
|
54
54
|
### Classification
|
|
55
55
|
|
|
56
|
-
| Classification | Types
|
|
57
|
-
| ------------------- |
|
|
58
|
-
| **Binary** | PDF, Excel, DOCX, ZIP, GZIP | `producedFiles` + `data` (extracted/parsed content) |
|
|
59
|
-
| **Structured text** | JSON, XML, CSV, YAML, HTML
|
|
60
|
-
| **RAW** | Unrecognized
|
|
56
|
+
| Classification | Types | Destination |
|
|
57
|
+
| ------------------- | --------------------------------- | -------------------------------------------------------------- |
|
|
58
|
+
| **Binary** | PDF, Excel, DOCX, PPTX, ZIP, GZIP | `producedFiles` + `data` (extracted/parsed content) |
|
|
59
|
+
| **Structured text** | JSON, XML, CSV, YAML, HTML | `data` only (parsed to JS objects) |
|
|
60
|
+
| **RAW** | Unrecognized | File if attachment/octet-stream/25MB fallback, else raw string |
|
|
61
61
|
|
|
62
62
|
Binary responses expose `stepFileKeys` and populate `sourceData.__files__`. Structured text responses only populate `sourceData.stepId.data`.
|
|
63
63
|
|
|
@@ -73,10 +73,13 @@ Binary responses expose `stepFileKeys` and populate `sourceData.__files__`. Stru
|
|
|
73
73
|
| Excel | Object keyed by sheet name, each value is array of row objects |
|
|
74
74
|
| PDF | `{ textContent, structuredContent: [{ page, text }] }` |
|
|
75
75
|
| DOCX | Markdown string |
|
|
76
|
+
| PPTX | Plain text, separated by slide |
|
|
76
77
|
| ZIP | Object keyed by entry filename, each value recursively parsed |
|
|
77
78
|
| GZIP | Recursively parsed inner content |
|
|
78
79
|
| RAW | UTF-8 string fallback |
|
|
79
80
|
|
|
81
|
+
**PPTX rules:** extraction includes slide text, including text inside basic tables. It does not include images, charts, layout, animations, or speaker notes.
|
|
82
|
+
|
|
80
83
|
**Excel rules:**
|
|
81
84
|
|
|
82
85
|
- Excel is never a flat array. It is always `{ "SheetName": [ {row}, ... ] }` — even for single-sheet files
|
|
@@ -68,8 +68,15 @@ Some APIs (e.g. Salesforce) use SOAP XML login where credentials are embedded in
|
|
|
68
68
|
|
|
69
69
|
`<<systemId_password>><<systemId_security_token>>` resolves to the password and token concatenated — no separator needed. This works in URL, headers, and body fields.
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
### Parsing XML responses
|
|
72
|
+
|
|
73
|
+
XML responses (SOAP and other XML APIs) are auto-parsed to an object on `sourceData.stepId.data`. The parser has quirks you MUST account for in transforms and stopConditions — probe the real response with a small page before writing selectors:
|
|
74
|
+
|
|
75
|
+
- **Every tag name is UPPERCASED.** `<response><record>` becomes `RESPONSE.RECORD`, regardless of the source casing. Always select uppercase keys.
|
|
76
|
+
- **Single vs multiple children collapse.** One child element parses to an object; multiple with the same tag parse to an array. Normalize before mapping: `const rows = Array.isArray(x) ? x : (x ? [x] : [])`.
|
|
77
|
+
- **Element attributes become keys on the element object** (also uppercased). `<data count="2" total="127">` gives `DATA.COUNT` and `DATA.TOTAL` alongside the child records.
|
|
78
|
+
- **Text with attributes goes to `_TEXT`.** An element with both attributes and text content stores the text under a `_TEXT` key. Empty elements (`<field></field>`) become `{}`.
|
|
79
|
+
- **Numbers and booleans are strings.** Everything is a string; wrap with `Number(...)` where you need arithmetic.
|
|
73
80
|
|
|
74
81
|
## HTTP Runtime Details
|
|
75
82
|
|
|
@@ -143,11 +150,15 @@ Multipart restrictions:
|
|
|
143
150
|
|
|
144
151
|
All HTTP responses are read as raw bytes, then classified by byte-level detection (see `file-handling.md` for the full detection logic).
|
|
145
152
|
|
|
146
|
-
- **
|
|
153
|
+
- **File responses**: formats classified as files by `file-handling.md` are stored as files, and parsed content populates `data` when extraction is available. Later steps can reference them via `file::<stepId>.raw/base64/extracted`.
|
|
147
154
|
- **`application/octet-stream`**: always treated as a file.
|
|
148
155
|
- **Responses over 25 MB**: treated as files as a safety fallback.
|
|
149
156
|
- **RAW + `Content-Disposition: attachment`**: treated as a file.
|
|
150
|
-
- **
|
|
157
|
+
- **Inline responses**: formats classified as structured or plain text by `file-handling.md` populate `data` without producing a stored file unless another file rule applies.
|
|
158
|
+
|
|
159
|
+
### XML Response Casing
|
|
160
|
+
|
|
161
|
+
XML responses are parsed into a JSON tree with ALL tag names normalized to UPPERCASE — the parsed keys will not match the raw document's casing. This applies identically to `sg system call` and to request steps in tools. A raw `fetch()` inside a transform step is the exception: it returns the original document with its real casing (often lowercase envelope tags with uppercase field tags). Never write string-level XML parsing logic in a transform from memory of what `sg system call` showed — capture a raw probe first (e.g. return `{ rawXml: xml.slice(0, 1500) }`), and guard against self-closing empty containers (`<data/>` has no closing tag) and repeated sibling result blocks.
|
|
151
162
|
|
|
152
163
|
### Error Detection
|
|
153
164
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# MongoDB
|
|
2
|
+
|
|
3
|
+
## Step Configuration
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
{
|
|
7
|
+
type: "request",
|
|
8
|
+
systemId: "my_mongo",
|
|
9
|
+
url: "mongodb://<<my_mongo_username>>:<<my_mongo_password>>@<<my_mongo_host>>:<<my_mongo_port>>/<<my_mongo_database>>?authSource=admin",
|
|
10
|
+
body: '{"collection": "users", "operation": "find", "filter": {"status": "active"}, "options": {"limit": 50, "sort": {"createdAt": -1}}}'
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Configure the connection URL based on the selected credential's secrets — use `sg system find` to inspect the available secret names and reference them accordingly.
|
|
15
|
+
|
|
16
|
+
`method`, `headers`, `queryParams`, and `pagination` are HTTP-only fields — omit them for MongoDB steps.
|
|
17
|
+
|
|
18
|
+
### Fields
|
|
19
|
+
|
|
20
|
+
| Field | Required | Notes |
|
|
21
|
+
| ---------- | -------- | -------------------------------------------------------------- |
|
|
22
|
+
| `url` | yes | Connection string with `<<credential>>` placeholders |
|
|
23
|
+
| `body` | yes | JSON: single operation object or array of operations |
|
|
24
|
+
| `systemId` | no | Links system credentials for `<<systemId_credKey>>` resolution |
|
|
25
|
+
|
|
26
|
+
### URL Format
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
mongodb://user:password@host:port/database?authSource=admin
|
|
30
|
+
mongodb+srv://user:password@cluster.example.mongodb.net/database (SRV seedlist, e.g. Atlas)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- `mongodb://` for a standard host:port connection.
|
|
34
|
+
- `mongodb+srv://` for DNS SRV seedlists (MongoDB Atlas). The driver resolves the seedlist and enables TLS automatically; do not add a port.
|
|
35
|
+
- The default database comes from the URL path; override per operation with a `database` field in the body.
|
|
36
|
+
- Common query params: `authSource` (auth database, usually `admin` for root users), `replicaSet`, `tls`, `retryWrites`.
|
|
37
|
+
- Special characters in the username or password are URL-encoded automatically before the driver parses the string.
|
|
38
|
+
|
|
39
|
+
### Body Format
|
|
40
|
+
|
|
41
|
+
JSON string with `operation` (required) and `collection` (required for all operations except `listCollections`). Bodies are parsed as MongoDB Extended JSON, so `{ "$oid": "..." }` becomes an `ObjectId` and `{ "$date": "..." }` becomes a `Date`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"collection": "orders",
|
|
46
|
+
"operation": "find",
|
|
47
|
+
"filter": { "_id": { "$oid": "652c1f77bcf86cd799439011" } }
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For several operations in one step, pass an array (executed in order, results returned as an array):
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
[
|
|
55
|
+
{ "collection": "orders", "operation": "countDocuments", "filter": { "status": "paid" } },
|
|
56
|
+
{
|
|
57
|
+
"collection": "orders",
|
|
58
|
+
"operation": "find",
|
|
59
|
+
"filter": { "status": "paid" },
|
|
60
|
+
"options": { "limit": 10 }
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Supported Operations
|
|
66
|
+
|
|
67
|
+
| Operation | Required fields | Returns |
|
|
68
|
+
| ------------------------------------------------------------- | ------------------------------------------------- | ---------------------------------------------- |
|
|
69
|
+
| `find` | `collection` | array of documents |
|
|
70
|
+
| `findOne` | `collection` | a document or `null` |
|
|
71
|
+
| `aggregate` | `collection`, `pipeline` | array of documents |
|
|
72
|
+
| `countDocuments` | `collection` | number |
|
|
73
|
+
| `estimatedDocumentCount` | `collection` | number |
|
|
74
|
+
| `distinct` | `collection`, `field` | array of values |
|
|
75
|
+
| `listCollections` | — | array of collection info |
|
|
76
|
+
| `insertOne` | `collection`, `document` | `{ acknowledged, insertedId }` |
|
|
77
|
+
| `insertMany` | `collection`, `documents` | `{ acknowledged, insertedCount, insertedIds }` |
|
|
78
|
+
| `updateOne` / `updateMany` | `collection`, `filter`, `update` | `{ matchedCount, modifiedCount, upsertedId }` |
|
|
79
|
+
| `replaceOne` | `collection`, `filter`, `replacement` | update result |
|
|
80
|
+
| `deleteOne` / `deleteMany` | `collection`, `filter` | `{ acknowledged, deletedCount }` |
|
|
81
|
+
| `findOneAndUpdate` / `findOneAndReplace` / `findOneAndDelete` | `collection`, `filter` (+ `update`/`replacement`) | the affected document |
|
|
82
|
+
| `bulkWrite` | `collection`, `operations` | bulk write result |
|
|
83
|
+
|
|
84
|
+
`filter`, `pipeline`, `document`, `update`, `replacement`, and driver `options` (e.g. `limit`, `skip`, `sort`, `projection`, `upsert`) are passed straight through to the driver.
|
|
85
|
+
|
|
86
|
+
Dynamic values with variables:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"collection": "users",
|
|
91
|
+
"operation": "find",
|
|
92
|
+
"filter": { "orgId": "<<(sourceData) => sourceData.orgId>>" }
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Authentication
|
|
97
|
+
|
|
98
|
+
Credentials are embedded directly in the connection URL using `<<systemId_credentialKey>>` placeholders. Nothing is injected automatically. Root/admin users almost always need `?authSource=admin`.
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
mongodb://<<my_mongo_username>>:<<my_mongo_password>>@<<my_mongo_host>>:<<my_mongo_port>>/<<my_mongo_database>>?authSource=admin
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## MongoDB Runtime Details
|
|
105
|
+
|
|
106
|
+
### Return Values
|
|
107
|
+
|
|
108
|
+
Documents are returned as Extended JSON (relaxed): an `ObjectId` becomes `{ "$oid": "..." }` and a `Date` becomes `{ "$date": "..." }`. Query those values back with the same form. A single operation returns its result directly; an array of operations returns an array of results in order.
|
|
109
|
+
|
|
110
|
+
### Connection Management
|
|
111
|
+
|
|
112
|
+
- Clients are reused per connection string within a run and closed after completion.
|
|
113
|
+
- TLS is automatic for `mongodb+srv://` and when the connection string sets `tls=true`.
|
|
114
|
+
- Connection timeout defaults to 30 seconds; operation/socket timeout follows the system/protocol timeout.
|
|
115
|
+
|
|
116
|
+
### Retry Behavior
|
|
117
|
+
|
|
118
|
+
Default retries come from server config. On final failure, the error includes the failing operation name.
|
|
119
|
+
|
|
120
|
+
## Common Pitfalls
|
|
121
|
+
|
|
122
|
+
- Omitting `?authSource=admin` when authenticating as a root user — auth fails with "Authentication failed".
|
|
123
|
+
- Adding a port to a `mongodb+srv://` URL — SRV connection strings must not include a port.
|
|
124
|
+
- Passing an `_id` as a plain string when the document stores an `ObjectId` — wrap it as `{ "$oid": "..." }` so it matches.
|
|
125
|
+
- Putting `limit`/`sort`/`projection` at the top level — they belong inside `options`.
|
|
126
|
+
- Accessing the step result directly instead of via `.data` — MongoDB results follow the same envelope as all steps: `sourceData.stepId.data`.
|
|
127
|
+
|
|
128
|
+
## Error Recovery
|
|
129
|
+
|
|
130
|
+
When a MongoDB step fails:
|
|
131
|
+
|
|
132
|
+
1. **Read the error message** — superglue includes the operation name in the error. Check for unknown operations, missing required fields (`filter`, `update`, `pipeline`), or malformed Extended JSON.
|
|
133
|
+
2. **Verify connection secrets** — use `sg system find` to confirm the stored secret names match the placeholders in your URL. Test with a `listCollections` operation via `sg system call`.
|
|
134
|
+
3. **Check auth source** — "Authentication failed" usually means a missing or wrong `authSource`. Root users authenticate against `admin`.
|
|
135
|
+
4. **Check connectivity** — connection refused or server-selection timeouts mean the host is unreachable, the SRV record can't resolve, or an IP allowlist (Atlas) is blocking you. `mongodb+srv://` requires outbound DNS.
|
|
136
|
+
5. **Check the operation shape** — read operations (`find`, `countDocuments`, `distinct`) never mutate; write operations require their specific fields. `aggregate` is read-only unless its pipeline contains a `$out` or `$merge` stage, which writes results back to a collection. Confirm `filter`/`update`/`pipeline` are objects/arrays, not strings.
|