Applies to v1.3.18

Calling Tools Over REST

Purpose

This page lists and invokes tools with plain HTTP requests, for an application that cannot use an MCP library or one of the SDKs. It shows the full request and response for each call, how input is shaped, and how a failure — the platform's or the downstream system's — comes back. The reference for discovery and invocation is Runtime Tool Discovery and Runtime Tool Invocation.

Before choosing this surface, note that the REST invoke endpoint addresses a tool by its tool id, not by the name a tool listing shows (see Finding a tool's id). An application that wants to call tools by name should use an SDK or MCP tools/call, which reach exactly the same tools under the same governance.

Listing Tools

curl https://apimapper.example.com/runtime/<tenant-id>/<client-id>/tools \
  -H "X-Api-Key: <api-key>"
{
  "tools": [
    {
      "name": "crm-get-customer",
      "title": "get-customer",
      "description": "Returns a customer by its customer number.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "customerNumber": { "type": "string", "description": "The customer number." }
        },
        "required": ["customerNumber"]
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "customerNumber": { "type": "string" },
          "name": { "type": "string" }
        }
      },
      "annotations": { "readOnlyHint": true }
    }
  ]
}

The listing contains the tools published to the client application in the path that this caller is allowed to see, in the same shape as an MCP tools/list, and all of them at once. Its schemas follow the toolset's schema discovery mode, exactly as over MCP — a tool in Lazy mode lists a placeholder schema; ask your administrator for the full contract, or use MCP, whose discover_tool_schema tool returns it.

Finding A Tool's Id

The invoke endpoint takes the tool's registry id. A tool that an MCP toolset publishes from a mapping endpoint has an id built from the ids of that toolset and that endpoint:

{toolset-id}::{endpoint-id}

Tools of other kinds, such as an ESRA retrieval tool, have ids of their own. The tool listing does not include the id. Your administrator can read it from the Portal's Tool Oversight screen, which shows each tool's id.

Invoking A Tool

The body is a JSON object of the tool's input fields, named as in its inputSchema. An empty body is treated as {}.

curl -X POST "https://apimapper.example.com/runtime/<tenant-id>/<client-id>/tools/<toolset-id>::<endpoint-id>/invoke" \
  -H "X-Api-Key: <api-key>" \
  -H "Content-Type: application/json" \
  -H "X-Correlation-Id: order-4711" \
  -d '{"customerNumber": "C-1001"}'
HTTP/1.1 200 OK
Content-Type: application/json
X-External-Correlation-Id: order-4711

{"customerNumber":"C-1001","name":"Example Ltd"}

The response is the downstream system's answer after the platform has mapped it back to the tool's published field names, and its HTTP status is the downstream system's status. A 201 from the downstream API is a 201 here; a 404 from the downstream API is a 404 here.

Input Fields And Validation

The input field names are the ones the administrator published for callers. The platform translates them into the downstream API's own request — path, query, headers and body — so a caller never sees or sends the downstream names.

The platform checks the input against the tool's contract and records any mismatch — a missing required field, a value of the wrong type — on the call's trace, where an operator sees it in Call Flow. It does not refuse the call for it: the downstream API's own validation decides, and its answer comes back to you as described below. Validate input against the published inputSchema on your side if you need to fail before the downstream call is made.

Responses And Errors

Status Body Meaning
The downstream status (2xx) The mapped downstream response The call succeeded
The downstream status (4xx or 5xx) The downstream response, mapped where the tool maps error fields The downstream system refused or failed the call. Read the body: the tool's mapping can publish error fields such as a title and status
400 Problem details, title Invalid runtime invocation The platform could not process the request
401 {"error": "…"} and a WWW-Authenticate header The credential is missing or invalid. See Authentication
403 Empty The tool's access policies do not allow this caller, the caller lacks the tools:invoke scope, or the tool has been taken offline by a security operator
404 Problem details, title Tool not found No such tool id, or the tool is not published to this client application
413 Problem details The request body is larger than the platform accepts (1 MiB by default)
429 Problem details, title Too many requests. A rate limit was reached. See Rate limits
502 Problem details with a code member, for example downstream_response_too_large The downstream response was larger than the platform accepts, or a stored-procedure tool exceeded one of its result limits

A tool backed by a SQL stored procedure answers failures with a {code, message} body; see Calling a stored procedure tool.

A 404 for a tool that exists is intended: a tool not published to your client application is indistinguishable from one that does not exist. Every refusal is still recorded in the audit trail with its real reason, which your administrator can read.

Correlating A Call

Send your own identifier in X-Correlation-Id; the platform echoes the value it accepted in X-External-Correlation-Id and records it on every audit record for the call. See Correlation IDs.