Overview

The Tools API exposes a unified gateway for executing agent tools. Tools can be built-in runtime primitives such as shell, file-system, HTTP, and code execution, or server-side tools that run inside the platform sandbox. The same registry backs the REST surface, the server-tools catalog, and the Model Context Protocol server, so every consumer sees the same tool set.

Base URL

The same routes are also available under the converged v1 surface:

Authentication

POST /tools/execute requires the caller to be identified through the x-allternit-user-id header. The platform auth middleware typically injects this header from a valid bearer token; direct calls must supply it explicitly. Optional identity headers are forwarded to tool handlers and audit logs.

Headers

Endpoints

List tools

Returns the built-in tool catalog. The response mirrors the same list under both tools and native so web and desktop registry consumers see a consistent catalog.

Example request

Example response

Execute a tool

Runs the requested tool with the supplied arguments. Execution is gated by the active permission policy. If the policy resolves to ask, the request is held and an approval_id is returned; use the approval endpoints to release it.

Request body

Response body

Built-in tools

Shell execution

Tool: shell.exec, shell.eval, bash Execute a shell command. For bash, an optional timeout argument and a restart advisory flag are accepted.

Example request

Example response

Code execution

Tool: code_execution Runs code in a sandboxed subprocess. Supported languages include python, node / javascript, bash, and rust.

Example request

Example response

File system

Tools: file.read, file.write, file.list, file.exists, file.remove Read, write, list, check, or remove files on the local filesystem.

Read a file

Write a file

HTTP requests

Tools: http.get, http.post Make outbound HTTP requests. http.post accepts optional body and headers arguments.

Example request

Example response

System information

Tools: system.info, system.env Return platform and environment details. system.env returns a single variable when key is provided, otherwise all environment variables.

Example request

Example response

Document conversion

Tools: document_to_markdown, url_to_markdown Convert uploaded documents or remote URLs into GitHub-flavored Markdown through the Office engine. Long output is truncated at 30,000 characters with an explicit note. document_to_markdown accepts exactly one of uploadId (from Uploads) or artifactId (from Artifacts). url_to_markdown requires url.

Example request

Example response

Time

Tool: time.now Return the current UTC time in several formats.

Echo

Tool: echo Return the supplied arguments unchanged. Useful for connectivity tests.

Approval flow

When the active permission policy resolves to ask, POST /tools/execute returns 202 Accepted with an approval_id. The tool is not executed until the caller or an authorized reviewer approves it.

Approval required response

Approve execution

Deny execution

Approving an execution runs the tool in the background; denying it discards the request. Both endpoints return 404 Not Found if the approval ID does not exist.

Server-side tools

When x-allternit-organization-id or x-allternit-tenant-id is present, the gateway first checks for a matching server-side tool registered for that organization. Server-side tools take precedence over built-in tools and run inside the platform sandbox. See Server Tools and MCP Servers for registration details.

Error codes