import Riza from '@riza-io/api';

const client = new Riza({
  apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const tool = await client.tools.create({ code: 'code', language: 'python', name: 'name' });

  console.log(tool.id);
}

main();
{
  "code": "<string>",
  "description": "<string>",
  "id": "<string>",
  "input_schema": "<any>",
  "language": "python",
  "name": "<string>",
  "revision_id": "<string>",
  "runtime_revision_id": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
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.

language
enum<string>
required

The language of the tool's code.

Available options:
python,
javascript,
typescript
name
string
required

The name of the tool.

description
string

A description of the tool.

input_schema
any

The input schema of the tool. This must be a valid JSON Schema object.

runtime_revision_id
string

The ID of the runtime revision to use when executing the tool.

Response

200
application/json
OK
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
any
required

The input schema of the tool. This must be a valid JSON Schema object.

language
enum<string>
required

The language of the tool's code.

Available options:
python,
javascript,
typescript
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.