For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
    • Overview
  • Runtype API
      • GETList tools
      • POSTCreate tool
      • GETList built-in tools
      • GETList compatible built-in tools
      • GETGet built-in tool schema
      • POSTConvert flow to tool
      • POSTDeploy Runtype Sandbox
      • DELCleanup Runtype Sandbox
      • POSTDeploy Daytona sandbox
      • DELCleanup Daytona sandbox
      • GETGet tool schemas
      • GETGet tool details
      • PUTUpdate tool
      • DELDelete tool
      • POSTExecute tool
      • POSTTest tool
Dashboard
LogoLogo
Runtype APITools

Create tool

POST
/v1/tools
POST
/v1/tools
$curl -X POST https://api.runtype.com/v1/tools \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "config": {
> "code": "const { operation, a, b } = parameters; switch(operation) { case '\''add'\'': return { result: a + b }; case '\''subtract'\'': return { result: a - b }; case '\''multiply'\'': return { result: a * b }; case '\''divide'\'': return { result: a / b }; }",
> "timeout": 5000
> },
> "description": "A simple calculator for basic math operations",
> "name": "Calculator Tool",
> "parametersSchema": {
> "properties": {
> "a": {
> "description": "First number",
> "type": "number"
> },
> "b": {
> "description": "Second number",
> "type": "number"
> },
> "operation": {
> "description": "The math operation to perform",
> "enum": [
> "add",
> "subtract",
> "multiply",
> "divide"
> ],
> "type": "string"
> }
> },
> "required": [
> "operation",
> "a",
> "b"
> ],
> "type": "object"
> },
> "toolType": "custom"
>}'
1{
2 "config": {},
3 "createdAt": "string",
4 "description": "string",
5 "id": "string",
6 "isActive": true,
7 "name": "string",
8 "organizationId": "string",
9 "toolType": "string",
10 "updatedAt": "string",
11 "userId": "string",
12 "parametersSchema": {},
13 "validation": {
14 "warnings": [
15 {
16 "code": "string",
17 "message": "string",
18 "severity": "error",
19 "column": 1.1,
20 "line": 1.1,
21 "suggestion": "string"
22 }
23 ]
24 }
25}
Create a new tool definition.
Was this page helpful?
Previous

List built-in tools

Next
Built with

Authentication

AuthorizationBearer
API key or Clerk session token

Request

This endpoint expects an object.
configmap from strings to anyRequired
descriptionstringRequired1-500 characters
namestringRequired1-100 characters
parametersSchemamap from strings to anyRequired
toolTypeenumRequired

Response

Created tool
configmap from strings to any or null
createdAtstring
descriptionstring or null
idstring
isActiveboolean
namestring
organizationIdstring or null
toolTypestring
updatedAtstring
userIdstring
parametersSchemamap from strings to any
validationobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error