Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions skills/one-actions/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ one --agent actions execute hub-spot <actionId> <connectionKey> \
one --agent actions execute shopify <actionId> <connectionKey> \
--path-vars '{"order_id": "12345"}' \
--query-params '{"limit": "10"}'

# With repeated query params (array values expand to repeated keys)
one --agent actions execute gmail <actionId> <connectionKey> \
--path-vars '{"userId": "me", "id": "msg123"}' \
--query-params '{"format": "metadata", "metadataHeaders": ["From", "Subject", "Date"]}'
```

Output format:
Expand All @@ -147,5 +152,6 @@ Parse the output as JSON. If the `error` key is present, the command failed —
- Always use the **exact action ID** from search results — don't guess or construct them
- Always read the knowledge output carefully — it tells you which parameters are required vs optional, what format they need to be in, and any caveats specific to that API
- JSON values passed to `-d`, `--path-vars`, `--query-params`, and `--headers` must be valid JSON strings (use single quotes around the JSON to avoid shell escaping issues)
- **Array query params**: Use JSON arrays for repeated query parameters — `{"metadataHeaders": ["From", "Subject"]}` expands to `metadataHeaders=From&metadataHeaders=Subject`
- If search returns no results, try broader queries (e.g., `"list"` instead of `"list active premium customers"`)
- The execute command respects access control settings configured via `one config` — if execution is blocked, the user may need to adjust their permissions
14 changes: 11 additions & 3 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,17 @@ export class OneApi {

let queryString = '';
if (args.queryParams && Object.keys(args.queryParams).length > 0) {
const params = new URLSearchParams(
Object.entries(args.queryParams).map(([k, v]) => [k, String(v)])
);
const entries: [string, string][] = [];
for (const [k, v] of Object.entries(args.queryParams)) {
if (Array.isArray(v)) {
for (const item of v) {
entries.push([k, String(item)]);
}
} else {
entries.push([k, String(v)]);
}
}
const params = new URLSearchParams(entries);
queryString = `?${params.toString()}`;
}

Expand Down