Tools

Create tool

POST /api/v1/agents/{agentId}/tools

Create tool

Creates a tool for an agent. The HMAC secret is stored but not returned. When the tool executes, Eloquent POSTs the tool input JSON to endpointUrl and includes X-Signature-Algorithm: sha256 plus X-Signature, an HMAC-SHA256 hex digest of the raw request body.

Parameters

Name In Type Description
agentId * path integer

Internal agent id that owns the tool.

Request body

CreateTool

Field Type Description
name * string

Tool name. Must start with a lowercase letter and use lowercase letters, numbers, or underscores.

description * string

Description that explains when and how the model should use the tool.

schema * object

JSON Schema object that defines the tool input parameters. When the agent uses the tool, Eloquent sends a JSON body matching this schema to the configured endpoint.

endpointUrl * string

HTTPS webhook endpoint called with a POST request when the tool executes. Eloquent sends the tool input as JSON and signs the raw request body with HMAC-SHA256.

hmacSecret * string

Secret used to sign tool execution requests. Use this value on your server to verify the X-Signature header against the raw JSON request body.

Responses

Status Schema Description
201 Tool

Created tool

400 ToolError

Invalid request body or tool schema

401 ToolError

Missing or invalid auth

403 ToolError

Caller cannot create tools for this agent

Example 201 response
{
    "id": 1,
    "name": "string",
    "description": "string",
    "schema": [],
    "endpointUrl": "string",
    "createdAt": "string",
    "updatedAt": "string"
}
Example 400 response
{
    "error": "string",
    "message": "string",
    "issues": [
        {
            "path": [
                "string"
            ],
            "message": "string",
            "code": "string"
        }
    ]
}
Example 401 response
{
    "error": "string",
    "message": "string",
    "issues": [
        {
            "path": [
                "string"
            ],
            "message": "string",
            "code": "string"
        }
    ]
}
Example 403 response
{
    "error": "string",
    "message": "string",
    "issues": [
        {
            "path": [
                "string"
            ],
            "message": "string",
            "code": "string"
        }
    ]
}