---
title: "Create tool"
method: POST
path: "/v1/tools"
tags: ["Tool"]
---

# Create tool

`POST /v1/tools`

Create a tool in your project.

## Request body

- CreateToolRequest
  - `code` string, required — The code of the tool. You must define a function named "execute" that takes in a single argument and returns a JSON-serializable value. The argument will be the "input" passed when executing the tool, and will match the input schema.
  - `description` string — A description of the tool.
  - `input_schema` unknown
  - `language` 'python' | 'javascript' | 'typescript', required — The language of the tool's code.
  - `name` string, required — The name of the tool.
  - `runtime_revision_id` string — The ID of the runtime revision to use when executing the tool.

## Response `200`

OK

- Tool
  - `code` string, required — The code of the tool. You must define a function named "execute" that takes in a single argument and returns a JSON-serializable value. The argument will be the "input" passed when executing the tool, and will match the input schema.
  - `description` string, required — A description of the tool.
  - `id` string, required — The ID of the tool.
  - `input_schema` unknown, required
  - `language` 'python' | 'javascript' | 'typescript', required — The language of the tool's code.
  - `name` string, required — The name of the tool.
  - `revision_id` string, required — The ID of the tool's current revision. This is used to pin executions to a specific version of the tool, even if the tool is updated later.
  - `runtime_revision_id` string — The ID of the custom runtime revision that the tool uses for executions. This pins executions to specific version of a custom runtime runtime, even if the runtime is updated later.

## Other responses

- `401` — Unauthenticated error response

## Changes

- **2025-02-05** `4ca61d8b4e33` — 1 breaking, 2 info
  - the `code` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `401`
  - added the new optional request property `runtime_revision_id`
  - added the optional property `runtime_revision_id` to the response with the `200` status
- **2025-01-15** `fbf471c508c8` — 4 breaking, 3 warning, 6 info
  - the request property `language` became required
  - removed the enum value `JAVASCRIPT` of the request property `language`
  - removed the enum value `PYTHON` of the request property `language`
  - removed the enum value `TYPESCRIPT` of the request property `language`
  - …9 more
- **2024-12-05** `9a6cae8060b4` — 2 breaking, 2 info
  - removed the enum value `PHP` of the request property `language`
  - removed the enum value `RUBY` of the request property `language`
  - removed the `PHP` enum value from the `language` response property for the response status `200`
  - removed the `RUBY` enum value from the `language` response property for the response status `200`
- **2024-11-06** `6a6ef20cc3e9` — 2 info
  - api operation id `createTool` was added
  - api tag `Tool` added
- **2024-11-06** `f91a367833f8` — 1 info
  - added the required property `language` to the response with the `200` status

[Full history](https://skmtc.dev/riza-io/apis/execute/changes/v1/tools/post.md)

---

[API](https://skmtc.dev/riza-io/apis/execute.md) · [All operations](https://skmtc.dev/riza-io/apis/execute/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/riza-io/execute/revisions/bab65e0b0c2b/schema)
