Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Making tool calls

Make tool calls using a REST API connector via Tool Proxy, or discover and execute tools from a custom MCP connector.

Use this page to make tool calls after the connector, connection, and connected account are set up.

The call method depends on the connector type:

  • REST API connectors — use actions.request() to proxy HTTP calls through Tool Proxy
  • MCP connectors — use list_scoped_tools to discover available tools, then execute_tool to call them

Both types use the same connection, connected account, and user authorization model.

Make sure:

Create a connection for your connector in the Scalekit Dashboard:

Connections page showing a custom connector connection alongside built-in connectors

After the user completes authorization, the connected account appears in the Connected Accounts tab:

Connected Accounts tab showing an authenticated account for a custom connector

In the request examples below, path is relative to the connector proxy_url. connectionName must match the connection you created, and identifier must match the connected account you want to use for the request.

import { ScalekitClient } from '@scalekit-sdk/node';
import 'dotenv/config';
const connectionName = 'your-provider-connection'; // get your connection name from connection configurations
const identifier = 'user_123'; // your unique user identifier
// Get your credentials from app.scalekit.com → Developers → Settings → API Credentials
const scalekit = new ScalekitClient(
process.env.SCALEKIT_ENV_URL,
process.env.SCALEKIT_CLIENT_ID,
process.env.SCALEKIT_CLIENT_SECRET
);
const actions = scalekit.actions;
// Authenticate the user
const { link } = await actions.getAuthorizationLink({
connectionName,
identifier,
});
console.log('Authorize connector:', link);
process.stdout.write('Press Enter after authorizing...');
await new Promise(r => process.stdin.once('data', r));
// Make a request via Scalekit proxy
const result = await actions.request({
connectionName,
identifier,
path: '/v1/customers',
method: 'GET',
});
console.log(result);

The request shape stays the same regardless of auth type — the connector definition controls how Scalekit authenticates the call.

MCP connectors expose tools from the upstream MCP server. Discover the available tools, then execute them by name.

Discover available tools (optional)

If you already know the tool names from the Scalekit Dashboard, you can skip this step.

Call list_scoped_tools with the connection name to see which tools the MCP server exposes for a given user.

import { ScalekitClient } from '@scalekit-sdk/node';
import 'dotenv/config';
const scalekit = new ScalekitClient(
process.env.SCALEKIT_ENV_URL,
process.env.SCALEKIT_CLIENT_ID,
process.env.SCALEKIT_CLIENT_SECRET
);
const connectionName = 'your-mcp-connection'; // connection name from Scalekit Dashboard
const identifier = 'user_123'; // your unique user identifier
const scoped = await scalekit.tools.listScopedTools(identifier, {
filter: { connectionNames: [connectionName] },
pageSize: 100,
});
const toolNames = scoped.tools?.map((st) => st.tool?.definition?.name) ?? [];
console.log('Available tools:', toolNames);

Call execute_tool with the connection name, identifier, and any tool-specific input.

const actions = scalekit.actions;
const result = await actions.executeTool({
toolName: 'tool_name_from_discovery', // replace with a name from list_scoped_tools
connector: 'your-mcp-connection',
identifier: 'user_123',
toolInput: { key: 'value' }, // replace with the tool's required input
});
console.log(result);