Call app tool legacy
POST /v1/organisations/{organisation_id}/workspaces/{workspace_id}/apps/{app_id}/instances/{instance_id}/tools/{tool}/calls Deprecated
Calls one of the app's tools on this running instance, as the caller, checked like a call from the agent: its page app's window.ivy.callTool(name, input) arrives here through the host. The call is recorded (app.tool_called), never its input or output; the session saves what the call changed in the working copy. A call has 40 s, on an instance that already runs; tools that take longer are for the agent.
Authentication
Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work
Scope the API key needs: conversations:write
Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)
Parameters
-
organisation_idpathstringrequired -
workspace_idpathstringrequired -
app_idpathstringrequired -
instance_idpathstringrequired -
toolpathstringrequiredThe tool's name as the app declares it, without the app's prefix
Request body
application/json CallAppTool required
-
inputobjectrequiredThe tool's input, checked against the schema the app declares for it.
Responses
-
What the app's MCP server answered;
is_errorwhen the tool reported an error -
unauthenticated -
Viewers can't use a
writeapp;workspace_content_restricted,insufficient_scope -
No such instance of this app (or the caller can't see its conversation);
app_tool_unavailable: the app declares no such tool, or offers no tools here -
app_not_running: the instance has stopped;app_runs_as_another: the instance runs as another person in the conversation; the caller stops it and, once it has stopped, starts the app again as themselves -
invalid_tool_input: the input doesn't fit the tool's schema;invalid_body -
rate_limited: the API key's requests per minute are used up; retry afterRetry-Afterseconds -
internal -
app_tool_failed: the app's MCP server failed, or didn't answer within 40 s -
sandbox_unavailable: the conversation's sandbox didn't answer; orunavailable: the database is briefly unavailable; retry afterRetry-Afterseconds
Error codes
Errors come back as an ErrorBody whose code is one of these.
- 401
unauthenticated - 403
workspace_content_restrictedinsufficient_scope - 404
app_tool_unavailable - 409
app_not_runningapp_runs_as_another - 422
invalid_tool_inputinvalid_body - 429
rate_limited - 500
internal - 502
app_tool_failed - 503
sandbox_unavailableunavailable
Examples
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/workspaces/$WORKSPACE_ID/apps/$APP_ID/instances/$INSTANCE_ID/tools/$TOOL/calls" \
-H "Authorization: Bearer $IVY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{}}' import { client, callAppToolLegacy } from "@spacivapp/ivy-sdk";
client.setConfig({
baseUrl: process.env.IVY_API_URL,
headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});
const { data, error, response } = await callAppToolLegacy({
path: { organisation_id: organisationId, workspace_id: workspaceId, app_id: appId, instance_id: instanceId, tool },
body: {
input: {}
},
}); {
"input": {}
} {
"content": [
{}
],
"is_error": false
}