> **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 the Upstream MCP server

The Upstream MCP connector routes your AI agent's tool calls to Upstream's own MCP server through Scalekit. Each user connects their own Upstream access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 46 tools.

**Authentication:** Bearer Token
**Categories:** Automation, Productivity
**Tools:** 46: 20 read, 22 write, 4 destructive
**Users sign in with:** Access token
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=UPSTREAMMCP)

## 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 Upstream MCP connection

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

   **Console steps with screenshots:**

   Register your Upstream Personal Access Token with Scalekit so it can authenticate and proxy inbox requests on behalf of your users. Upstream MCP uses bearer token authentication.

   1. ## Get a bearer token

      - Sign in to your Upstream account and open your account settings.

      - Find the **Personal Access Tokens** (or API tokens) section.

      - Click **Create token**. Give it a name (e.g., `Agent Auth`) and confirm.

      - Copy the token immediately — it will not be shown again.

   2. ## Create a connection in Scalekit

      - In [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections**. Find **Upstream** and click **Create**.

      - Note the **Connection name** — you will use this as `connection_name` in your code (e.g., `upstreammcp`).

   3. ## Add a connected account

      Connected accounts link a specific user identifier in your system to an Upstream Personal Access Token. Add one in the dashboard to test. In production, each user adds their own through the authorization link: they enter their credentials on the page it opens.

      **In the dashboard, to test**

      - Open the connection you created and click the **Connected Accounts** tab → **Add account**.

      - Fill in:
        - **Your User's ID** — a unique identifier for this user in your system (e.g., `user_123`)
        - **Bearer Token** — the Personal Access Token you copied in step 1

      - Click **Save**.

      **From your backend, if your app already has the credentials**

      For example, when users enter them on a settings page in your app:

        **Node.js**

        ```typescript
        import { ConnectorStatus } from '@scalekit-sdk/node'

        const authorizationDetails = {
          details: {
            case: 'staticAuth',
            value: { details: { token: 'upstream_pat_...' } },
          },
        };

        let { connectedAccount } = await scalekit.actions.upsertConnectedAccount({
          connectionName: 'upstreammcp',
          identifier: 'user_123',       // your user's unique ID
          authorizationDetails,
        });

        // Make sure the account is ACTIVE before the first tool call.
        if (connectedAccount?.status !== ConnectorStatus.ACTIVE) {
          ({ connectedAccount } = await scalekit.actions.upsertConnectedAccount({
            connectionName: 'upstreammcp',
            identifier: 'user_123',
            authorizationDetails,
          }));
        }
        ```

        **Python**

        ```python
        authorization_details = {"static_auth": {"token": "upstream_pat_..."}}

        response = scalekit_client.actions.upsert_connected_account(
            connection_name="upstreammcp",
            identifier="user_123",
            authorization_details=authorization_details,
        )

        # Make sure the account is ACTIVE before the first tool call.
        if response.connected_account.status != "ACTIVE":
            response = scalekit_client.actions.upsert_connected_account(
                connection_name="upstreammcp",
                identifier="user_123",
                authorization_details=authorization_details,
            )
        ```

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'upstreammcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Upstream MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'upstreammcp_get_inbox_split_threads',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "upstreammcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Upstream MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="upstreammcp_get_inbox_split_threads",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Upstream MCP server credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## 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: 'upstreammcp_get_channel_threads',
  toolInput: {
    channelId: '<channelId>',
  },
  connector: 'upstreammcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="upstreammcp_get_channel_threads",
    tool_input={
        "channelId": "<channelId>",
    },
    connection_name="upstreammcp",
    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.

### `upstreammcp_get_channel_threads`

Get Channel Threads · Read-only

List threads in a specific channel. Use list-channels first to get channel IDs. Returns paginated thread list with subjects, senders, and dates.

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

Inputs:

- `channelId` (`string`, required): Channel ID from list-channels
- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

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

### `upstreammcp_get_inbox_split_threads`

Get Inbox Split Threads · Read-only

List threads in a specific inbox split, category, or system split. Provide exactly one of splitId, category, or systemSplit. Get valid filter values from list-inbox-splits first.

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

Inputs:

- `category` (`string`, optional): Inbox category (e.g. CATEGORY_PRIMARY). One of: `CATEGORY_PRIMARY`, `CATEGORY_PERSONAL`, `CATEGORY_PROMOTIONS`, `CATEGORY_SOCIAL`, `CATEGORY_UPDATES`, `CATEGORY_FORUMS`.
- `limit` (`integer`, optional): Page size, 1-100 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response
- `splitId` (`string`, optional): Custom inbox split ID from list-inbox-splits
- `systemSplit` (`string`, optional): System split: "follow-ups", "needs-reply", or "cold-emails". One of: `follow-ups`, `needs-reply`, `cold-emails`, `followups`, `autodrafts`.

Example input: `{}`

### `upstreammcp_get_label_threads`

Get Label Threads · Read-only

List threads with a specific label. Use list-labels first to get label IDs. Returns paginated thread list.

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

Inputs:

- `labelId` (`string`, required): Label ID from list-labels
- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

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

### `upstreammcp_get_self`

Get Current User · Read-only

Get current user profile, account status, settings, and organization memberships in one call. Useful for understanding user identity, feature flags, unread counts, and AI draft configuration.

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

Inputs: none.

Example input: `{}`

### `upstreammcp_list_channels`

List Channels · Read-only

List all channels the user belongs to. Channels are team shared spaces for organizing threads. Returns channel IDs, names, colors, member counts, and unread counts. Use get-channel-threads to browse threads within a channel.

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

Inputs: none.

Example input: `{}`

### `upstreammcp_list_contacts`

List Contacts · Read-only

List all contacts the user has interacted with. Returns email addresses, display names, and profile pictures. Useful for finding recipient addresses when composing or replying to emails.

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

Inputs: none.

Example input: `{}`

### `upstreammcp_list_draft_threads`

List Draft Threads · Read-only

List new thread drafts saved through MCP. Returns unsent draft threads owned by the user.

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

Inputs:

- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

Example input: `{}`

### `upstreammcp_list_inbox_splits`

ListInboxSplits · Read-only

List all inbox splits visible to the authenticated user, in display order. Includes Primary, system splits (Needs Reply, Follow Ups), custom splits, and category splits (Promotions, Social, Updates). Each entry contains a filter_param object — pass it directly to get-inbox-split-threads. Use this tool first to discover available splits before fetching threads.

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

Inputs: none.

Example input: `{}`

### `upstreammcp_list_labels`

List Labels · Read-only

List all labels the user has created. Returns label IDs, names, and colors. Use get-label-threads to browse threads with a specific label.

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

Inputs: none.

Example input: `{}`

### `upstreammcp_list_org_members`

List Organization Members · Read-only

List all members of an organization. Returns user IDs, names, emails, and profile pictures. Use get-self to find your organization ID.

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

Inputs:

- `organizationId` (`string`, required): Organization ID (from get-self)

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

### `upstreammcp_list_rules`

List Rules · Read-only

List all inbox automation rules. Rules automatically apply actions (add to channel, add label, star, mark spam) to matching emails. Returns rule IDs, queries, actions, and whether they apply to incoming mail.

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

Inputs: none.

Example input: `{}`

### `upstreammcp_list_scheduled_threads`

List Scheduled Threads · Read-only

List threads with scheduled sends. Returns threads with messages scheduled for future delivery.

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

Inputs:

- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

Example input: `{}`

### `upstreammcp_list_sent_threads`

List Sent Threads · Read-only

List threads from the Sent folder. Returns sent emails with subjects, recipients, and dates.

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

Inputs:

- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

Example input: `{}`

### `upstreammcp_list_snoozed_threads`

List Snoozed Threads · Read-only

List snoozed threads. Returns threads the user has deferred to reappear later.

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

Inputs:

- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

Example input: `{}`

### `upstreammcp_list_spam_threads`

List Spam Threads · Read-only

List threads in the Spam folder. Returns threads marked as spam.

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

Inputs:

- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

Example input: `{}`

### `upstreammcp_list_starred_threads`

List Starred Threads · Read-only

List starred/flagged threads. Returns threads the user has starred for quick access.

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

Inputs:

- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

Example input: `{}`

### `upstreammcp_list_trashed_threads`

List Trashed Threads · Read-only

List threads in the Trash. Returns deleted threads that can be restored.

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

Inputs:

- `limit` (`integer`, optional): Max results, 1-50 (default 20)
- `pageToken` (`string`, optional): Cursor for next page from previous response

Example input: `{}`

### `upstreammcp_read_thread`

Read Thread · Read-only

Read a thread with its messages. Use response_format "concise" (default) for metadata and snippets only — saves context tokens. Use "detailed" for full message bodies when you need complete content.

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

Inputs:

- `threadId` (`string`, required): Thread ID from get-inbox-split-threads or search-inbox
- `response_format` (`string`, optional): Level of detail: "concise" (default) returns snippets; "detailed" returns full bodies. One of: `concise`, `detailed`.

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

### `upstreammcp_read_thread_comments`

Read Thread Comments · Read-only

Read internal team comments on a thread (not visible to external recipients). Comments are scoped to an organization. Use get-self to find your organization ID. Use response_format "concise" (default) for snippets; "detailed" for full bodies.

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

Inputs:

- `organizationId` (`string`, required): Organization ID (from get-self)
- `threadId` (`string`, required): Thread ID from search-inbox or get-inbox-split-threads
- `response_format` (`string`, optional): Level of detail: "concise" (default) returns snippets; "detailed" returns full bodies. One of: `concise`, `detailed`.

Example input: `{"organizationId":"<organizationId>","threadId":"<threadId>"}`

### `upstreammcp_search_inbox`

Search Inbox · Read-only

Search across all inbox threads by keyword or phrase. Returns matching threads with subjects, senders, and dates. More efficient than browsing splits when looking for specific content. Use read-thread to get full details of a specific result.

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

Inputs:

- `query` (`string`, required): Search query — matches subject, body, and sender fields
- `limit` (`integer`, optional): Max results, 1-50 (default 10)
- `pageToken` (`string`, optional): Cursor for next page from previous response

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

### `upstreammcp_compose_thread`

Compose New Thread · Write

Create and send a new email thread. Requires at least one recipient in the "to" field. Optionally assign to channels for team visibility.

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

Inputs:

- `body` (`string`, required): Email body (HTML supported)
- `to` (`array`, required): Primary recipients (email addresses)
- `bcc` (`array`, optional): BCC recipients
- `cc` (`array`, optional): CC recipients
- `channelIds` (`array`, optional): Channel IDs to assign this thread to (from list-channels)
- `includeSignatures` (`boolean`, optional): Whether to append Gmail and Upstream signatures when they are not already present. Default: `true`.
- `subject` (`string`, optional): Email subject line

Example input: `{"body":"<body>","to":[]}`

### `upstreammcp_create_channel`

Create Channel · Write

Create a new team channel for organizing and sharing threads. Requires an organization membership. Use get-self to find your organization ID.

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

Inputs:

- `name` (`string`, required): Channel name
- `organizationId` (`string`, required): Organization ID (from get-self)
- `color` (`string`, optional): Channel color (defaults to lynch). One of: `lynch`, `sea_pink`, `sunglo`, `burning_sand`, `rob_roy`, `shadow_green`, `silver_tree`, `monte_carlo`, `blue_chill`, `jordy_blue`, `cornflower_blue`, `biloba_flower`, `lavender_floral`, `light_orchid`.
- `isPublic` (`boolean`, optional): Whether the channel is public (default: true)

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

### `upstreammcp_create_inbox_split`

Create Inbox Split · Write

Create a new custom inbox split. Splits filter inbox threads by a query string (matching sender, subject, body). Use list-inbox-splits to see existing splits.

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

Inputs:

- `name` (`string`, required): Split display name
- `query` (`string`, required): Filter query — emails matching this appear in the split
- `showInCategorySplit` (`boolean`, optional): Also show matching threads in their original category (default: true). Default: `true`.

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

### `upstreammcp_create_label`

Create Label · Write

Create a new label for organizing threads. Use manage-thread-labels to apply labels to threads after creation.

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

Inputs:

- `name` (`string`, required): Label name
- `color` (`string`, optional): Label color (defaults to slate_gray). Available: slate_gray, lavender_gray, jelly_bean, pale_chestnut, mandarin, apricot, mellow_apricot, very_pale_orange, naples_yellow, blond, medium_aquamarine, magic_mint, forest_green, jet_stream, cadet_blue, crystal, havelock_blue, beau_blue, medium_purple, pale_lavender, pastel_magenta, pale_pink, tuscany, timberwolf. One of: `slate_gray`, `lavender_gray`, `jelly_bean`, `pale_chestnut`, `mandarin`, `apricot`, `mellow_apricot`, `very_pale_orange`, `naples_yellow`, `blond`, `medium_aquamarine`, `magic_mint`, `forest_green`, `jet_stream`, `cadet_blue`, `crystal`, `havelock_blue`, `beau_blue`, `medium_purple`, `pale_lavender`, `pastel_magenta`, `pale_pink`, `tuscany`, `timberwolf`.

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

### `upstreammcp_create_rule`

Create Rule · Write

Create a new inbox automation rule. Rules match emails by query string and add matching emails to a channel automatically. Queries match against sender, subject, and body. Set applyToIncoming=true to apply to future incoming emails, bulkApplication=true to apply to existing matching threads.

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

Inputs:

- `actions` (`array`, required): Actions to apply on matching emails
- `query` (`string`, required): Match query — emails matching this text trigger the rule
- `applyToIncoming` (`boolean`, optional): Apply to future incoming emails (default: true). Default: `true`.
- `bulkApplication` (`boolean`, optional): Also apply to existing matching threads (default: false). Default: `false`.

Example input: `{"actions":[],"query":"<query>"}`

### `upstreammcp_done_thread`

Done Thread · Write

Archive/mark a thread as done, removing it from the inbox. The thread remains accessible via search or folder views but leaves the active inbox. Pass the inbox item IDs (from get-inbox-split-threads results).

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

Inputs:

- `inboxItemIds` (`array`, required): Inbox item IDs to mark done (from get-inbox-split-threads)

Example input: `{"inboxItemIds":[]}`

### `upstreammcp_generate_draft`

Generate AI Draft · Write

Generate an AI-powered draft reply for a thread. Returns the draft text directly — use it with reply-to-thread to send. The draft is based on thread context, user writing style, and optional custom instructions. Consumes one draft quota unit.

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

Inputs:

- `threadId` (`string`, required): Thread ID to generate a draft for
- `currentDraftBody` (`string`, optional): Optional existing draft body to refine or continue
- `customInstructions` (`string`, optional): Optional instructions to guide draft generation (e.g. "be formal", "decline politely")

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

### `upstreammcp_manage_channel_participants`

Add/Remove Channel Members · Write

Add or remove members from a channel. Use list-org-members to find user IDs and list-channels to find channel IDs.

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

Inputs:

- `action` (`string`, required): "add" to invite members, "remove" to remove them. One of: `add`, `remove`.
- `channelId` (`string`, required): Channel ID to modify
- `participantIds` (`array`, required): User IDs to add or remove

Example input: `{"action":"add","channelId":"<channelId>","participantIds":[]}`

### `upstreammcp_manage_thread_channels`

Add/Remove Thread Channels · Write

Add or remove channel assignments on one or more threads. Use list-channels to get available channel IDs.

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

Inputs:

- `action` (`string`, required): "add" to assign to channels, "remove" to unassign. One of: `add`, `remove`.
- `channelIds` (`array`, required): Channel IDs to add or remove
- `threadIds` (`array`, required): Thread IDs to modify

Example input: `{"action":"add","channelIds":[],"threadIds":[]}`

### `upstreammcp_manage_thread_followers`

Add/Remove Thread Followers · Write

Add or remove followers on a thread. Followers get notifications about thread activity. Use list-org-members to get user IDs.

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

Inputs:

- `action` (`string`, required): "add" to follow, "remove" to unfollow. One of: `add`, `remove`.
- `threadId` (`string`, required): Thread ID to modify followers on
- `userIds` (`array`, required): User IDs to add or remove as followers

Example input: `{"action":"add","threadId":"<threadId>","userIds":[]}`

### `upstreammcp_manage_thread_labels`

Add/Remove Thread Labels · Write

Add or remove labels on one or more threads. Use list-labels to get available label IDs.

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

Inputs:

- `action` (`string`, required): "add" to apply labels, "remove" to take them off. One of: `add`, `remove`.
- `labelIds` (`array`, required): Label IDs to add or remove
- `threadIds` (`array`, required): Thread IDs to modify

Example input: `{"action":"add","labelIds":[],"threadIds":[]}`

### `upstreammcp_mark_read`

Mark Thread as Read · Write

Mark all messages in a thread as read. Clears the unread indicator for this thread.

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

Inputs:

- `threadId` (`string`, required): Thread ID to mark as read

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

### `upstreammcp_move_to_category`

Move to Category · Write

Move threads from one inbox category to another. Use list-inbox-splits to see available categories.

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

Inputs:

- `fromCategory` (`string`, required): Current category of the threads. One of: `CATEGORY_PRIMARY`, `CATEGORY_PERSONAL`, `CATEGORY_PROMOTIONS`, `CATEGORY_SOCIAL`, `CATEGORY_UPDATES`, `CATEGORY_FORUMS`.
- `threadIds` (`array`, required): Thread IDs to move
- `toCategory` (`string`, required): Target category to move threads to. One of: `CATEGORY_PRIMARY`, `CATEGORY_PERSONAL`, `CATEGORY_PROMOTIONS`, `CATEGORY_SOCIAL`, `CATEGORY_UPDATES`, `CATEGORY_FORUMS`.

Example input: `{"fromCategory":"CATEGORY_PRIMARY","threadIds":[],"toCategory":"CATEGORY_PRIMARY"}`

### `upstreammcp_post_thread_comment`

Post Thread Comment · Write

Post an internal team comment on a thread. Comments are only visible to organization members, not to external email recipients. Use get-self to find your organization ID.

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

Inputs:

- `body` (`string`, required): Comment body (HTML supported)
- `organizationId` (`string`, required): Organization ID (from get-self)
- `threadId` (`string`, required): Thread ID to comment on

Example input: `{"body":"<body>","organizationId":"<organizationId>","threadId":"<threadId>"}`

### `upstreammcp_reply_to_thread`

Reply to Thread · Write

Send a reply in an existing thread. You must provide at least one "to" recipient. Use read-thread to see existing participants. Optionally add cc/bcc addresses.

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

Inputs:

- `body` (`string`, required): Reply message body (HTML supported)
- `threadId` (`string`, required): Thread ID to reply to
- `to` (`array`, required): "To" recipients — use read-thread to see thread participants
- `bcc` (`array`, optional): BCC recipients (email addresses)
- `cc` (`array`, optional): CC recipients (email addresses)
- `includeSignatures` (`boolean`, optional): Whether to append Gmail and Upstream signatures when they are not already present. Default: `true`.

Example input: `{"body":"<body>","threadId":"<threadId>","to":[]}`

### `upstreammcp_save_draft_reply`

Save Draft Reply · Write

Save a draft reply in an existing thread without sending it. If recipients are omitted, Upstream stores no recipients on the draft and uses the current default reply recipients when the draft is opened. If recipients are provided, they replace the defaults and are stored on the draft.

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

Inputs:

- `body` (`string`, required): Draft reply body (HTML supported)
- `threadId` (`string`, required): Thread ID to save a draft reply for
- `explanation` (`string`, optional): Optional user-visible explanation shown with the saved draft in Upstream
- `overwriteExistingDraft` (`boolean`, optional): Whether to replace an existing active draft on this thread. Default: `false`.
- `recipients` (`object`, optional): Optional full recipient override. If omitted, Upstream uses current default reply recipients when the draft is opened.

Example input: `{"body":"<body>","threadId":"<threadId>"}`

### `upstreammcp_save_draft_thread`

Save Draft Thread · Write

Save a new email thread draft without sending it. Recipients and channel IDs are optional and can be added later in Upstream. Use compose-thread when the message should be sent immediately.

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

Inputs:

- `body` (`string`, required): Draft body (HTML supported)
- `bcc` (`array`, optional): BCC recipients
- `cc` (`array`, optional): CC recipients
- `channelIds` (`array`, optional): Channel IDs to assign this draft thread to (from list-channels)
- `subject` (`string`, optional): Email subject line
- `to` (`array`, optional): Primary recipients (email addresses)

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

### `upstreammcp_snooze_thread`

Snooze Thread · Write

Snooze a thread until a specific date/time. The thread will be removed from the inbox and reappear at the specified time. Use list-snoozed-threads to see currently snoozed threads.

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

Inputs:

- `snoozeUntil` (`string`, required): ISO 8601 date-time when the thread should reappear (e.g. "2025-01-15T09:00:00Z")
- `threadId` (`string`, required): Thread ID to snooze

Example input: `{"snoozeUntil":"2025-01-15T09:00:00Z","threadId":"<threadId>"}`

### `upstreammcp_star_threads`

Star/Unstar Threads · Write

Star or unstar one or more threads. Starred threads appear in list-starred-threads.

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

Inputs:

- `starred` (`boolean`, required): true to star, false to unstar
- `threadIds` (`array`, required): Thread IDs to star/unstar

Example input: `{"starred":true,"threadIds":[]}`

### `upstreammcp_update_inbox_split`

Update Inbox Split · Write

Update an existing custom inbox split. Only provided fields are changed. Use list-inbox-splits to get split IDs.

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

Inputs:

- `splitId` (`string`, required): Inbox split ID to update
- `name` (`string`, optional): New display name
- `query` (`string`, optional): New filter query
- `showInCategorySplit` (`boolean`, optional): Whether to also show in category view

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

### `upstreammcp_update_rule`

Update Rule · Write

Update an existing inbox automation rule. Only provided fields are updated; omitted fields remain unchanged. Only ADD_TO_CHANNEL actions are currently supported. Use list-rules first to get rule IDs.

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

Inputs:

- `ruleId` (`string`, required): Rule ID to update (from list-rules)
- `actions` (`array`, optional): New actions (replaces all existing actions)
- `query` (`string`, optional): New match query

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

### `upstreammcp_update_settings`

Update User Settings · Write

Update user settings like auto-draft configuration, theme, and notification preferences. Only provided fields are changed. Use get-self to see current settings first.

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

Inputs:

- `autoAdvanceEnabled` (`boolean`, optional): Automatically advance to next thread after triaging
- `autoDraftEnabled` (`boolean`, optional): Enable or disable AI auto-drafting
- `brandingSignatureEnabled` (`boolean`, optional): Include branding in email signature
- `gmailSignatureEnabled` (`boolean`, optional): Include the primary Gmail signature in sent emails

Example input: `{}`

### `upstreammcp_delete_inbox_split`

Delete Inbox Split · Destructive

Permanently delete a custom inbox split. Threads previously in this split remain in their categories. Use list-inbox-splits to get split IDs.

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

Inputs:

- `splitId` (`string`, required): Inbox split ID to delete

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

### `upstreammcp_delete_rule`

Delete Rule · Destructive

Permanently delete an inbox automation rule. Use list-rules first to get rule IDs.

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

Inputs:

- `ruleId` (`string`, required): Rule ID to delete (from list-rules)

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

### `upstreammcp_mark_spam`

Mark as Spam / Not Spam · Destructive

Mark a thread as spam or remove the spam designation. Spam threads are moved to the spam folder.

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

Inputs:

- `spam` (`boolean`, required): true to mark as spam, false to mark as not spam
- `threadId` (`string`, required): Thread ID

Example input: `{"spam":true,"threadId":"<threadId>"}`

### `upstreammcp_trash_threads`

Trash/Untrash Threads · Destructive

Move threads to trash or restore them. Trashed threads can be restored with trashed=false. Use list-trashed-threads to see trashed threads.

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

Inputs:

- `threadIds` (`array`, required): Thread IDs to trash/untrash
- `trashed` (`boolean`, required): true to trash, false to restore from trash

Example input: `{"threadIds":[],"trashed":true}`

## Workflows

**Tool calling**

- Use `upstreammcp_search_inbox` to find threads by keyword across subject, body, and sender before reading them.
- Use `upstreammcp_get_inbox_split_threads` with `systemSplit: "needs-reply"` to list threads that are waiting on the user.
- Use `upstreammcp_read_thread` to load a thread's messages — the default `concise` format saves context tokens.
- Use `upstreammcp_generate_draft` to get an AI-drafted reply for a thread, then `upstreammcp_reply_to_thread` to send it.
- Use `upstreammcp_done_thread` to archive a thread once it is handled.

  **Node.js**

  ```typescript
  const toolResponse = await actions.executeTool({
    connector: 'upstreammcp',
    identifier: 'user_123',
    toolName: 'upstreammcp_search_inbox',
    toolInput: {
      query: 'invoice',
      limit: 10,
    },
  });
  console.log('Matching threads:', toolResponse.data);
  ```

  **Python**

  ```python
  tool_response = actions.execute_tool(
      connection_name='upstreammcp',
      identifier='user_123',
      tool_name='upstreammcp_search_inbox',
      tool_input={
          "query": "invoice",
          "limit": 10,
      },
  )
  print("Matching threads:", tool_response)
  ```

## Related

Other Automation connectors ([all 66](/agentkit/connectors/?category=automation)):

- [Mailchimp](/agentkit/connectors/mailchimp/): Scalekit connector, OAuth, 73 tools
- [Twilio](/agentkit/connectors/twilio/): Scalekit connector, Username and password, 61 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 |
