Execute a tool
Runs one tool as a user, with that user's credentials for the connection. Identify the account with connector and identifier, or with connected_account_id, and pass the tool's inputs in params; each connector page lists its tools and their inputs. When the connected account is EXPIRED, the call returns 401 with TOOL_ERROR; when it's otherwise not ACTIVE, 400 with INVALID_ARGUMENT. Either way, send the user an authorization link. Errors and rate limits explains each tool error code.
Authorization
Authorization: Bearer $TOKEN, an access token from the client credentials grant. See Authentication.
Body
tool_namestringrequiredagent_run_idstringconnected_account_idstringconnectorstringidentifierstringorganization_idstringparamsobjectuser_idstringscalekit_client.actions.execute_tool
Execute a tool with the given parameters.
scalekit_client.actions.execute_tool( tool_input: ToolInput, tool_name: str, identifier: Optional[str] = None, tool_request: Optional[ToolRequest] = None, connected_account_id: Optional[str] = None, connection_name: Optional[str] = None,) -> ExecuteToolResponseParameters
tool_inputToolInputrequiredtool_namestrrequiredidentifierOptional[str]connected_account_idOptional[str]connection_nameOptional[str]Returns ExecuteToolResponse: The tool's output in data, and the execution_id.
From scalekit-sdk-python 2.19.1.
scalekit.actions.executeTool
Execute a tool on behalf of a connected account. Identify the account with connector and identifier, or with connectedAccountId.
scalekit.actions.executeTool( params: { toolName: string; toolInput: Record<string, unknown>; identifier?: string; connectedAccountId?: string; connector?: string; organizationId?: string; userId?: string; },): Promise<ExecuteToolResponse>Parameters
toolNamestringrequiredtoolInputRecord<string, unknown>requiredidentifierstringconnectedAccountIdstringconnectorstringorganizationIdstringuserIdstringReturns Promise<ExecuteToolResponse>.
From @scalekit-sdk/node 2.18.0.
Response 200
dataobjectexecution_idstringErrors
Every error has the same body: code, message and details. See Errors and rate limits.
400Invalid request - error code INVALID_ARGUMENT when the tool name is missing, the input doesn't match the tool's schema, the connected account belongs to a different app than the tool, or the account isn't ACTIVE. Error code TOOL_ERROR when the app rejected the call; tool_error_info.tool_error_code is INVALID_ARGUMENT, EXECUTION_ERROR, INTERNAL_ERROR or, for a tool from an app's MCP server, TOOL_ERROR, and tool_error_message has the app's message.401Error code UNAUTHENTICATED when your access token is missing, invalid or expired; get a new token and retry. Error code TOOL_ERROR with tool_error_code REAUTHENTICATION_NEEDED or UNAUTHENTICATED when the user's access to the app was revoked or expired; send the user a new authorization link.403Error code TOOL_ERROR with tool_error_code FORBIDDEN or PERMISSION_DENIED - the app refused the call. The account's credentials are valid but lack the scope this tool needs. The connected account stays ACTIVE; grant the missing scope on the connection, have the user authorize again, then retry.404Not found - the tool or the connected account doesn't exist. Error code TOOL_ERROR with tool_error_code RESOURCE_NOT_FOUND when the app couldn't find what the call refers to, such as an event ID.429Error code TOOL_ERROR with tool_error_code RATE_LIMITED - the app rate-limited the call. Back off and retry.500Error code TOOL_ERROR with tool_error_code INTERNAL_ERROR when Scalekit couldn't run the tool, for example because the connection's auth type isn't supported for this tool. For a tool from an app's MCP server, tool_error_code TOOL_ERROR when that server failed, rate-limited the call or couldn't be reached; its status is in tool_error_message. A retry can run the tool twice, so retry only tools that are safe to repeat, and quote execution_id to support.Used in
- Anthropic
- Build a daily briefing agent with Vercel AI SDK and Scalekit AgentKit
- Build a LiveKit voice agent with Scalekit AgentKit tools
- Build a Mastra agent with Scalekit AgentKit tools
- Build a multi-user GitHub PR summarizer agent
- Build an agent that books meetings and drafts emails
- Call your connector
- FastRouter + Scalekit tool calling
- Migrate from Composio to Scalekit
- OpenAI
- Quickstart
- Use built-in tools
- Vercel AI SDK
Every connector page shows this call with that connector's tools and their inputs.