Skip to main content
POST
/
workspace
/
{workspace_id}
/
tool
Create a new tool using XanoScript
curl --request POST \
  --url https://your-xano-instance.xano.io/api:meta/workspace/{workspace_id}/tool \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: text/x-xanoscript' \
  --data 'tool foo {
  input {
    int score
  }
  stack {
    var $x1 {
      value = $input.score + 1
    }
  }
  response = $x1
}
'
{
  "id": 1,
  "created_at": "2023-04-19 21:01:32+0000",
  "updated_at": "2023-04-19 21:01:32+0000",
  "name": "Tool Test",
  "description": "My tool description",
  "docs": "Documentation",
  "instructions": "Instructions",
  "guid": "YE1fwVhQ-enRlc6Sb42Gqru58-0",
  "branch": "v1",
  "tag": [
    "example tag"
  ],
  "xanoscript": {
    "status": "ok",
    "value": "<string>",
    "message": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace_id
integer<int64>
required

Query Parameters

branch
string
default:""
include_xanoscript
boolean
default:false

Body

text/x-xanoscript

The body is of type string.

Example:

"tool foo {\n input {\n int score\n }\n stack {\n var $x1 {\n value = $input.score + 1\n }\n }\n response = $x1\n}\n"

Response

Success!

id
integer<int64>
default:1
created_at
string<timestamptz>
default:2023-04-19 21:01:32+0000
updated_at
string<timestamptz>
default:2023-04-19 21:01:32+0000
name
string
default:Tool Test
description
string
default:My tool description
docs
string
default:Documentation
instructions
string
default:Instructions
guid
string
default:YE1fwVhQ-enRlc6Sb42Gqru58-0
branch
string
default:v1
tag
string[]
xanoscript
object