> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Alpaca

The Alpaca connector lets your AI agent act in each user's Alpaca account. Each user connects their own Alpaca API key and secret once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 30 tools.

**Authentication:** API Key ID + Secret Key
**Categories:** Accounting & Finance
**Tools:** 30: 19 read, 5 write, 6 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=ALPACA)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Alpaca connection

   In **AgentKit > Connections**, create an Alpaca connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'alpaca_account_activities_list',
  toolInput: {},
  connector: 'alpaca',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="alpaca_account_activities_list",
    tool_input={},
    connection_name="alpaca",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `alpaca_account_activities_list`

List Account Activities · Read-only

List account activities such as order fills, dividends, fees, interest and cash transfers, newest first.
Returns an array of activities with id, activity_type, date or transaction_time, symbol, qty, price, net_amount and order_id.
Use this to reconcile trades and cash movements. Use alpaca_orders_list for order status and alpaca_portfolio_history_get for equity over time.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `activity_types` (`string`, optional): Comma-separated activity types to include, such as FILL (order fills), DIV (dividends), TRANS (cash transactions), FEE, INT (interest), JNLC (cash journals) or CSD (cash deposits). Cannot be used with category. Example: FILL,DIV
- `after` (`string`, optional): Only return activities created after this time. Format YYYY-MM-DD or RFC 3339. Example: 2026-10-01T00:00:00Z
- `category` (`string`, optional): Activity category: trade_activity (fills) or non_trade_activity (cash, dividends, fees and other entries). Cannot be used with activity_types. Example: trade_activity. One of: `trade_activity`, `non_trade_activity`.
- `date` (`string`, optional): Only return activities created on this date (creation date, not settlement date). Format YYYY-MM-DD or RFC 3339. Example: 2026-11-02
- `direction` (`string`, optional): Sort order by activity time: asc or desc. Default: desc. Example: desc. One of: `asc`, `desc`.
- `order_id` (`string`, optional): Only return activities for this order ID, for example the fills that make up an order. Example: 61e69015-8549-4bfd-b9c3-01e75843f47d
- `page_size` (`integer`, optional): Maximum activities to return, 1 to 100. Default: 100. Example: 50
- `page_token` (`string`, optional): Pagination token: the ID of the last activity on the previous page. Example: 20261102093000000::8e2b3c3f-6a37-4c6f-9d1c-0d9b5c9a1f00
- `until` (`string`, optional): Only return activities created before this time. Format YYYY-MM-DD or RFC 3339. Example: 2026-11-01T00:00:00Z

Example input: `{}`

### `alpaca_account_configurations_get`

Get Account Configurations · Read-only

Get the account's trading configuration.
Returns settings such as dtbp_check, no_shorting, suspend_trade, trade_confirm_email, fractional_trading, max_margin_multiplier and max_options_trading_level.
Use this to see why an order type or margin level is blocked. Use alpaca_account_get for balances.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `alpaca_account_get`

Get Account · Read-only

Get the trading account the connection belongs to.
Returns account id, number, status, currency, cash, buying power, equity, portfolio value, pattern day trader flag and trading restrictions.
Use this to check funds and buying power before placing an order. Use alpaca_positions_list for holdings.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `alpaca_asset_get`

Get Asset · Read-only

Get one asset by symbol, asset ID or CUSIP.
Returns id, symbol, name, class, exchange, status, tradable, marginable, shortable, easy_to_borrow and fractionable.
Use this to check whether a symbol can be traded before placing an order. Use alpaca_assets_list to browse.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `symbol_or_asset_id` (`string`, required): Ticker symbol, asset ID (UUID) or CUSIP of the asset. Example: AAPL

Example input: `{"symbol_or_asset_id":"<symbol_or_asset_id>"}`

### `alpaca_assets_list`

List Assets · Read-only

List tradable and non-tradable assets, filtered by status, class, exchange or attributes.
Returns an array of assets with id, symbol, name, class, exchange, status, tradable, fractionable and shortable. The list can be very large; filter it.
Use this to browse the universe. Use alpaca_asset_get when you know the symbol.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `asset_class` (`string`, optional): Asset class: us_equity (the default), us_option, crypto, crypto_perp or us_index. Example: us_equity
- `attributes` (`string`, optional): Comma-separated asset attributes to filter by, such as ptp_no_exception, ptp_with_exception, ipo, has_options or options_late_close. Example: has_options
- `exchange` (`string`, optional): Comma-separated exchanges for us_equity and us_index assets: AMEX, ARCA, BATS, NYSE, NASDAQ, NYSEARCA, OTC, TXSE or INDEX. Example: NASDAQ
- `status` (`string`, optional): Asset status to include, for example active or inactive. All statuses by default. Example: active

Example input: `{}`

### `alpaca_calendar_get`

Get Market Calendar · Read-only

Get a market's trading calendar between two dates.
Returns each trading day with its date, sessions, and open and close times.
Use this to plan around holidays and early closes. Use alpaca_clock_get for the current session.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `market` (`string`, required): Market identifier (MIC, BIC or acronym), such as NYSE, NASDAQ, OPRA, BOATS, SIFMA or XLON. Example: NYSE
- `end` (`string`, optional): Last date to return, YYYY-MM-DD. Default: one week after start. Example: 2026-12-31
- `start` (`string`, optional): First date to return, YYYY-MM-DD. Default: today. Example: 2026-11-16
- `timezone` (`string`, optional): Timezone for the returned times. Only UTC is accepted; default is the market's own timezone. Example: UTC. One of: `UTC`.

Example input: `{"market":"<market>"}`

### `alpaca_clock_get`

Get Market Clock · Read-only

Get whether markets are open now and when they next open and close.
Returns, per market, is_market_day, phase, the current session and the next market open and close times.
Use this before trading to check the session. Use alpaca_calendar_get for future trading days.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `markets` (`string`, optional): Comma-separated market codes, such as NYSE, NASDAQ, OPRA, IEX, BOATS or XLON. Example: NYSE,NASDAQ
- `time` (`string`, optional): Use this time instead of now, RFC 3339. Example: 2026-11-16T14:30:00Z

Example input: `{}`

### `alpaca_news_list`

List News · Read-only

List market news articles, newest first, optionally for specific symbols.
Returns news with id, headline, author, summary, url, symbols, source, created_at and optional content, plus next_page_token.
Use this to research a stock before trading.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `end` (`string`, optional): Inclusive end, RFC 3339 or YYYY-MM-DD. Default: now. Example: 2026-11-15
- `exclude_contentless` (`boolean`, optional): If true, leave out articles that have no content. Example: false
- `include_content` (`boolean`, optional): If true, include the article content when available. Example: false
- `limit` (`integer`, optional): Articles per page, 1 to 50. Example: 10
- `page_token` (`string`, optional): Token from next_page_token of the previous response. Example: MTcwMDAwMDAwMDAwMDAwMDAwMHwzNTk5MTYwNg==
- `sort` (`string`, optional): Sort by updated date: asc or desc. Default: desc. Example: desc. One of: `asc`, `desc`.
- `start` (`string`, optional): Inclusive start, RFC 3339 or YYYY-MM-DD. Default: start of today. Example: 2026-11-10
- `symbols` (`string`, optional): Comma-separated symbols to get news for. Example: AAPL,TSLA

Example input: `{}`

### `alpaca_option_contracts_list`

List Option Contracts · Read-only

List option contracts, filtered by underlying, expiration, type, style and strike range.
Returns option_contracts with id, symbol, name, type, style, strike_price, expiration_date, open_interest and close_price, plus next_page_token.
Use this to find a contract symbol before placing an options order with alpaca_order_create.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `expiration_date` (`string`, optional): Exact expiration date, YYYY-MM-DD. Example: 2026-12-18
- `expiration_date_gte` (`string`, optional): Expiration on or after this date, YYYY-MM-DD. Example: 2026-11-20
- `expiration_date_lte` (`string`, optional): Expiration on or before this date, YYYY-MM-DD. Defaults to the next weekend. Example: 2027-01-15
- `limit` (`integer`, optional): Contracts per page. Default 100, maximum 10000. Example: 100
- `page_token` (`string`, optional): Token from next_page_token of the previous response, to get the next page. Example: eyJpZCI6IjU1MGU4NDAwLWUyOWIifQ
- `root_symbol` (`string`, optional): Root symbol to filter by. Example: AAPL
- `show_deliverables` (`boolean`, optional): If true, include the deliverables array for each contract. Example: false
- `status` (`string`, optional): Contract status: active or inactive. Only active contracts by default. Example: active. One of: `active`, `inactive`.
- `strike_price_gte` (`number`, optional): Strike price greater than or equal to this value. Example: 180
- `strike_price_lte` (`number`, optional): Strike price less than or equal to this value. Example: 220
- `style` (`string`, optional): Exercise style: american or european. Example: american. One of: `american`, `european`.
- `type` (`string`, optional): Contract type: call or put. Example: call. One of: `call`, `put`.
- `underlying_symbols` (`string`, optional): Comma-separated underlying symbols to filter by. Example: AAPL,SPY

Example input: `{}`

### `alpaca_order_get`

Get Order · Read-only

Get one order by its ID.
Returns the order with status, filled_qty, filled_avg_price, limit and stop prices, timestamps and any legs.
Use this to check whether an order filled. Use alpaca_orders_list to find order IDs.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `order_id` (`string`, required): Alpaca order ID (a UUID). Get it from alpaca_orders_list or the response of alpaca_order_create. Example: 61e69015-8549-4bfd-b9c3-01e75843f47d
- `nested` (`boolean`, optional): If true, legs of a multi-leg order are rolled up under the legs field. Example: true

Example input: `{"order_id":"<order_id>"}`

### `alpaca_orders_list`

List Orders · Read-only

List orders on the account, open ones by default, optionally filtered by status, time, symbol or side.
Returns an array of orders with id, client_order_id, symbol, side, type, qty, filled_qty, limit_price, status and submitted_at.
Use this to find an order ID or check fills. Use alpaca_order_get for one order and alpaca_account_activities_list for fill history.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `after` (`string`, optional): Only orders submitted after this timestamp (exclusive), RFC 3339. Example: 2026-11-01T00:00:00Z
- `asset_class` (`string`, optional): Comma-separated asset classes to include, such as us_equity, us_option or crypto. Example: us_equity,us_option
- `direction` (`string`, optional): Sort by submission time: asc or desc. Default: desc. Example: desc. One of: `asc`, `desc`.
- `limit` (`integer`, optional): Maximum orders to return. Default 50, maximum 500. Example: 50
- `nested` (`boolean`, optional): If true, multi-leg orders (bracket, OCO, OTO, mleg) are rolled up under the legs field of the primary order. Example: true
- `side` (`string`, optional): Only orders on this side: buy or sell. Example: buy. One of: `buy`, `sell`.
- `status` (`string`, optional): Which orders to return: open, closed or all. Default: open. Example: all. One of: `open`, `closed`, `all`.
- `symbols` (`string`, optional): Comma-separated symbols to filter by. Crypto orders need the currency pair. Example: AAPL,TSLA
- `until` (`string`, optional): Only orders submitted until this timestamp (exclusive), RFC 3339. Example: 2026-11-08T00:00:00Z

Example input: `{}`

### `alpaca_portfolio_history_get`

Get Portfolio History · Read-only

Get the account's equity and profit-and-loss time series over a period.
Returns parallel arrays timestamp, equity, profit_loss and profit_loss_pct, plus base_value and timeframe.
Use this to chart performance. Use alpaca_account_get for the current balance only.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `cashflow_types` (`string`, optional): Cash flow activities to include in the report: ALL, NONE, or a comma-separated list of activity types. Example: ALL
- `end` (`string`, optional): Last timestamp of the series, RFC 3339 or YYYY-MM-DD. Defaults to the most recent session. Example: 2026-11-01
- `intraday_reporting` (`string`, optional): For intraday timeframes, which timestamps to return: market_hours, extended_hours or continuous. Default: market_hours. Example: market_hours. One of: `market_hours`, `extended_hours`, `continuous`.
- `period` (`string`, optional): Total duration as a number plus unit: D (day), W (week), M (month) or A (year). Do not send together with both start and end. Default: 1M. Example: 1M
- `pnl_reset` (`string`, optional): For intraday queries, how the profit-and-loss baseline is set: per_day (reset every day, the default) or no_reset. Example: per_day. One of: `no_reset`, `per_day`.
- `start` (`string`, optional): First timestamp of the series, RFC 3339 or YYYY-MM-DD. Defaults to end minus period. Example: 2026-10-01
- `timeframe` (`string`, optional): Resolution of each data point: 1Min, 5Min, 15Min, 1H or 1D. If empty, Alpaca picks one based on the period. Example: 1D. One of: `1D`, `1H`, `15Min`, `5Min`, `1Min`.

Example input: `{}`

### `alpaca_position_get`

Get Position · Read-only

Get the open position for one symbol or asset ID.
Returns qty, side, avg_entry_price, market_value, cost_basis, unrealized_pl and current_price; 404 if there is no position.
Use this for one holding. Use alpaca_positions_list for all holdings.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `symbol_or_asset_id` (`string`, required): Ticker symbol or asset ID (UUID) of the position. Crypto pairs are written without the slash. Example: AAPL

Example input: `{"symbol_or_asset_id":"<symbol_or_asset_id>"}`

### `alpaca_positions_list`

List Positions · Read-only

List all open positions on the account.
Returns an array of positions with symbol, asset_class, qty, side, avg_entry_price, market_value, cost_basis, unrealized_pl and current_price.
Use this to see holdings. Use alpaca_position_get for one symbol.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `alpaca_stock_bars_get`

Get Stock Bars · Read-only

Get historical price bars (open, high, low, close, volume) for one or more stocks.
Returns bars keyed by symbol, each with t, o, h, l, c, v, n and vw, plus next_page_token.
Use this for price history and charts. Use alpaca_stock_snapshots_get for the latest prices.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `symbols` (`string`, required): Comma-separated list of stock ticker symbols. Example: AAPL,MSFT,TSLA
- `timeframe` (`string`, required): Bar size: [1-59]Min (or T), [1-23]Hour (or H), 1Day (or D), 1Week (or W), or [1,2,3,4,6,12]Month (or M). Example: 1Day
- `adjustment` (`string`, optional): Corporate action adjustment, as a comma-separated list of raw, split, dividend, spin-off or all. Default: raw. Example: split,dividend
- `asof` (`string`, optional): As-of date used to map the symbol to its underlying entity across name changes, YYYY-MM-DD. Default: today. Example: 2026-11-15
- `currency` (`string`, optional): Currency for all prices, in ISO 4217 format. Default: USD. Example: USD
- `end` (`string`, optional): Inclusive end of the interval, RFC 3339 or YYYY-MM-DD. Default: now (15 minutes ago without real-time access). Example: 2026-11-01
- `feed` (`string`, optional): Data feed: sip (all US exchanges, the default; recent data needs a paid subscription), iex (free), boats or otc. Example: iex. One of: `iex`, `otc`, `sip`, `boats`.
- `limit` (`integer`, optional): Maximum data points per page across all symbols, 1 to 10000. Default: 1000. Example: 1000
- `page_token` (`string`, optional): Token from next_page_token of the previous response. Example: QUFQTHxNfDIwMjYtMTAtMDE=
- `sort` (`string`, optional): Sort by timestamp: asc or desc. Default: asc. Example: asc. One of: `asc`, `desc`.
- `start` (`string`, optional): Inclusive start of the interval, RFC 3339 or YYYY-MM-DD. Default: start of today. Example: 2026-10-01

Example input: `{"symbols":"<symbols>","timeframe":"<timeframe>"}`

### `alpaca_stock_latest_quotes_get`

Get Latest Stock Quotes · Read-only

Get the latest bid and ask quote for one or more stocks.
Returns quotes keyed by symbol, each with t, bp (bid price), bs (bid size), ap (ask price), as (ask size) and exchange codes.
Use this to price a limit order. Use alpaca_stock_snapshots_get for trades and bars as well.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `symbols` (`string`, required): Comma-separated list of stock ticker symbols. Example: AAPL,MSFT,TSLA
- `currency` (`string`, optional): Currency for all prices, in ISO 4217 format. Default: USD. Example: USD
- `feed` (`string`, optional): Market data feed. sip covers all US exchanges and needs a paid Algo Trader Plus subscription for recent data; iex is the free Investors Exchange feed; delayed_sip is SIP with a 15-minute delay; boats and overnight are overnight trading feeds; otc is over-the-counter. Leave empty for Alpaca's default for your subscription. Example: iex. One of: `delayed_sip`, `iex`, `otc`, `sip`, `boats`, `overnight`.

Example input: `{"symbols":"<symbols>"}`

### `alpaca_stock_snapshots_get`

Get Stock Snapshots · Read-only

Get a snapshot of the latest market state for one or more stocks.
Returns per symbol the latestTrade, latestQuote, minuteBar, dailyBar and prevDailyBar.
Use this for a current price overview. Use alpaca_stock_latest_quotes_get for bid and ask only and alpaca_stock_bars_get for history.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `symbols` (`string`, required): Comma-separated list of stock ticker symbols. Example: AAPL,MSFT,TSLA
- `currency` (`string`, optional): Currency for all prices, in ISO 4217 format. Default: USD. Example: USD
- `feed` (`string`, optional): Market data feed. sip covers all US exchanges and needs a paid Algo Trader Plus subscription for recent data; iex is the free Investors Exchange feed; delayed_sip is SIP with a 15-minute delay; boats and overnight are overnight trading feeds; otc is over-the-counter. Leave empty for Alpaca's default for your subscription. Example: iex. One of: `delayed_sip`, `iex`, `otc`, `sip`, `boats`, `overnight`.

Example input: `{"symbols":"<symbols>"}`

### `alpaca_watchlist_get`

Get Watchlist · Read-only

Get one watchlist by ID, with its assets.
Returns id, name and assets (each with symbol, name, exchange and tradable).
Use this to read the symbols in a list. Use alpaca_watchlists_list to find the ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `watchlist_id` (`string`, required): Watchlist ID (a UUID). Get it from alpaca_watchlists_list. Example: 3174d6df-7726-44b4-a5bd-7fda5ae6e009

Example input: `{"watchlist_id":"<watchlist_id>"}`

### `alpaca_watchlists_list`

List Watchlists · Read-only

List the account's watchlists.
Returns an array of watchlists with id, name, created_at and updated_at (without their assets).
Use this to find a watchlist ID. Use alpaca_watchlist_get to see the symbols in one.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `alpaca_order_create`

Place Order · Write

Place a stock, option or crypto order: market, limit, stop, stop-limit or trailing stop, including bracket, OCO, OTO and multi-leg option orders.
Returns the new order with id, client_order_id, status, symbol, side, type, qty and submitted_at.
On a live connection this trades real money. Use alpaca_order_replace to change an open order and alpaca_order_cancel to cancel it.
Check buying power with alpaca_account_get first.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `time_in_force` (`string`, required): How long the order stays active: day, gtc, opg, cls, ioc or fok. Options accept day and gtc; crypto accepts gtc and ioc. Example: day. One of: `day`, `gtc`, `opg`, `cls`, `ioc`, `fok`.
- `type` (`string`, required): Order type: market, limit, stop, stop_limit or trailing_stop. Options support market, limit, stop and stop_limit; multi-leg options support market and limit. Example: limit. One of: `market`, `limit`, `stop`, `stop_limit`, `trailing_stop`.
- `client_order_id` (`string`, optional): Your own unique ID for the order, up to 128 characters. Generated if empty. Example: rebalance-2026-11-15-aapl
- `extended_hours` (`boolean`, optional): If true, the order can fill in pre-market, after-hours and overnight sessions. Only for limit orders with time_in_force day or gtc. Default: false. Example: false
- `legs` (`array`, optional): Up to 4 legs for an mleg (multi-leg options) order. Each leg names the option contract symbol, its side, a ratio_qty and optionally a position_intent. Example: [{"symbol": "AAPL261218C00190000", "side": "buy", "ratio_qty": "1", "position_intent": "buy_to_open"}, {"symbol": "AAPL261218C00200000", "side": "sell", "ratio_qty": "1", "position_intent": "sell_to_open"}]
- `limit_price` (`string`, optional): Limit price, as a string. Required for limit and stop_limit orders. For mleg orders a positive value is a debit and a negative value a credit. Example: 182.50
- `notional` (`string`, optional): Dollar amount to trade, as a string. Only for market orders with time_in_force day. Send qty or notional, not both. Example: 500.00
- `order_class` (`string`, optional): Order class: simple (or empty), bracket, oco or oto for equities; mleg for multi-leg option strategies. Example: bracket. One of: `simple`, `bracket`, `oco`, `oto`, `mleg`.
- `position_intent` (`string`, optional): For options, the position strategy: buy_to_open, buy_to_close, sell_to_open or sell_to_close. Example: buy_to_open. One of: `buy_to_open`, `buy_to_close`, `sell_to_open`, `sell_to_close`.
- `qty` (`string`, optional): Number of shares or contracts, as a string. Fractional quantities work only for market and day orders. Send qty or notional, not both. Required for mleg orders. Example: 10
- `side` (`string`, optional): buy or sell. Required for every order class except mleg. Example: buy. One of: `buy`, `sell`.
- `stop_loss` (`object`, optional): Stop-loss leg for bracket, oco or oto orders, with a stop_price and an optional limit_price. Example: {"stop_price": "170.00", "limit_price": "169.50"}
- `stop_price` (`string`, optional): Stop price, as a string. Required for stop and stop_limit orders. Example: 175.00
- `symbol` (`string`, optional): Symbol, asset ID or crypto currency pair to trade. Required for every order class except mleg. Example: AAPL
- `take_profit` (`object`, optional): Take-profit leg for bracket, oco or oto orders, with a limit_price. Example: {"limit_price": "195.00"}
- `trail_percent` (`string`, optional): Trailing amount as a percent of the high-water mark, as a string. trailing_stop orders need trail_price or trail_percent. Example: 1.5
- `trail_price` (`string`, optional): Trailing amount in dollars, as a string. trailing_stop orders need trail_price or trail_percent. Example: 2.50

Example input: `{"time_in_force":"day","type":"market"}`

### `alpaca_order_replace`

Replace Order · Write

Replace an open order with new quantity, prices or time in force.
Returns the new order that replaces the original; the original is marked replaced.
Use this to adjust a working order. Use alpaca_order_cancel to cancel it instead and alpaca_order_create to place a new one.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `order_id` (`string`, required): Alpaca order ID (a UUID). Get it from alpaca_orders_list or the response of alpaca_order_create. Example: 61e69015-8549-4bfd-b9c3-01e75843f47d
- `client_order_id` (`string`, optional): New unique client order ID for the replacement order, up to 128 characters. Example: rebalance-2026-11-15-aapl-v2
- `limit_price` (`string`, optional): New limit price, as a string. Needed when the original order is limit or stop_limit. Example: 181.00
- `qty` (`string`, optional): New quantity, as a string. Only whole shares can be changed; fractional and non-IPO notional orders cannot be replaced. Example: 15
- `stop_price` (`string`, optional): New stop price, as a string, for stop or stop_limit orders. Example: 174.00
- `time_in_force` (`string`, optional): New time in force: day, gtc, opg, cls, ioc or fok. Example: gtc. One of: `day`, `gtc`, `opg`, `cls`, `ioc`, `fok`.
- `trail` (`string`, optional): New trail_price or trail_percent value, as a string. Only for trailing_stop orders. Example: 2.00

Example input: `{"order_id":"<order_id>"}`

### `alpaca_watchlist_asset_add`

Add Asset to Watchlist · Write

Add one symbol to a watchlist.
Returns the updated watchlist with id, name and assets.
Use this to append a symbol. Use alpaca_watchlist_update to replace the whole list.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `symbol` (`string`, required): Symbol to add to the watchlist. Example: TSLA
- `watchlist_id` (`string`, required): Watchlist ID (a UUID). Get it from alpaca_watchlists_list. Example: 3174d6df-7726-44b4-a5bd-7fda5ae6e009

Example input: `{"symbol":"<symbol>","watchlist_id":"<watchlist_id>"}`

### `alpaca_watchlist_create`

Create Watchlist · Write

Create a watchlist with a name and optional symbols.
Returns the watchlist with id, name and assets.
Use this to start a new list. Use alpaca_watchlist_asset_add to add symbols to an existing one.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Watchlist name, unique on the account. Example: Tech Stocks
- `symbols` (`array`, optional): Symbols to add to the watchlist. Example: ["AAPL", "MSFT"]

Example input: `{"name":"<name>"}`

### `alpaca_watchlist_update`

Update Watchlist · Write

Rename a watchlist and/or replace its whole symbol list.
Returns the updated watchlist with id, name and assets.
Use this to overwrite the list. Use alpaca_watchlist_asset_add or alpaca_watchlist_asset_remove to change one symbol.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `watchlist_id` (`string`, required): Watchlist ID (a UUID). Get it from alpaca_watchlists_list. Example: 3174d6df-7726-44b4-a5bd-7fda5ae6e009
- `name` (`string`, optional): New watchlist name. Send name, symbols or both. Example: Tech Leaders
- `symbols` (`array`, optional): Full list of symbols; it replaces the current assets. Send name, symbols or both. Example: ["AAPL", "NVDA"]

Example input: `{"watchlist_id":"<watchlist_id>"}`

### `alpaca_order_cancel`

Cancel Order · Destructive

Cancel one open order by its ID.
Returns no content on success; 422 if the order can no longer be canceled.
Use this for a single order. Use alpaca_orders_cancel_all to cancel every open order.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `order_id` (`string`, required): Alpaca order ID (a UUID). Get it from alpaca_orders_list or the response of alpaca_order_create. Example: 61e69015-8549-4bfd-b9c3-01e75843f47d

Example input: `{"order_id":"<order_id>"}`

### `alpaca_orders_cancel_all`

Cancel All Orders · Destructive

Cancel every open order on the account.
Returns an array with each order ID and the HTTP status of its cancel request.
Use this to stop all trading activity at once. Use alpaca_order_cancel for a single order.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `alpaca_position_close`

Close Position · Destructive

Close all or part of the position in one symbol by placing a market order against it.
Returns the liquidation order with id, symbol, side, qty and status.
On a live connection this trades real money. Use alpaca_positions_close_all to close every position.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `symbol_or_asset_id` (`string`, required): Ticker symbol or asset ID (UUID) of the position. Crypto pairs are written without the slash. Example: AAPL
- `percentage` (`number`, optional): Percent of the position to liquidate, 0 to 100, up to 9 decimals. Cannot be used with qty. Example: 50
- `qty` (`number`, optional): Number of shares to liquidate, up to 9 decimals. Cannot be used with percentage. Leave both empty to close the whole position. Example: 5

Example input: `{"symbol_or_asset_id":"<symbol_or_asset_id>"}`

### `alpaca_positions_close_all`

Close All Positions · Destructive

Liquidate every open position on the account with market orders.
Returns an array with each symbol, the HTTP status of its close request and the order placed.
On a live connection this trades real money. Use alpaca_position_close for a single symbol.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `cancel_orders` (`boolean`, optional): If true, cancel all open orders before liquidating the positions. Example: true

Example input: `{}`

### `alpaca_watchlist_asset_remove`

Remove Asset from Watchlist · Destructive

Remove one symbol from a watchlist.
Returns the updated watchlist with id, name and assets.
Use this to drop a symbol. Use alpaca_watchlist_delete to delete the whole list.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `symbol` (`string`, required): Symbol to remove from the watchlist. Example: TSLA
- `watchlist_id` (`string`, required): Watchlist ID (a UUID). Get it from alpaca_watchlists_list. Example: 3174d6df-7726-44b4-a5bd-7fda5ae6e009

Example input: `{"symbol":"<symbol>","watchlist_id":"<watchlist_id>"}`

### `alpaca_watchlist_delete`

Delete Watchlist · Destructive

Delete a watchlist.
Returns no content on success.
Use this to remove the whole list. Use alpaca_watchlist_asset_remove to drop one symbol.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `watchlist_id` (`string`, required): Watchlist ID (a UUID). Get it from alpaca_watchlists_list. Example: 3174d6df-7726-44b4-a5bd-7fda5ae6e009

Example input: `{"watchlist_id":"<watchlist_id>"}`

## Related

Other Accounting & Finance connectors ([all 82](/agentkit/connectors/?category=accounting-finance)):

- [QuickBooks](/agentkit/connectors/quickbooks/): Scalekit connector, OAuth, 117 tools
- [Xero](/agentkit/connectors/xero/): Scalekit connector, OAuth, 94 tools
- [Stripe](/agentkit/connectors/stripe/): Scalekit connector, Access token, 178 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
