---
title: "Create a new assistant tool"
method: POST
path: "/assistantTool"
tags: ["Assistant Tools"]
---

# Create a new assistant tool

`POST /assistantTool`

Create a new custom assistant tool

## Request body

- CreateToolRequest
  - `name` string, required
  - `definition` string, required — JSON string containing the tool definition
  - `function` string, required — JavaScript code for the tool execution
  - `icon_url` string

## Response `200`

Tool created successfully

- GetToolResponse
  - `tool` ToolDetail
    - `_id` string
    - `name` string
    - `icon_url` string
    - `definition` string — JSON string containing the tool definition with parameters and schema
    - `function` string — JavaScript code that executes the tool's logic
    - `user_id` string
    - `type` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `__v` integer

## Other responses

- `400` — Invalid input
- `401` — Unauthorized

---

[API](https://skmtc.net/smartly/apis/smartly-ai-apis.md) · [All operations](https://skmtc.net/smartly/apis/smartly-ai-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smartly/smartly-ai-apis/revisions/1e26909d86c9/schema)
