> ## Documentation Index
> Fetch the complete documentation index at: https://docs.riza.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create tool

> Create a tool in your project.



## OpenAPI

````yaml post /v1/tools
openapi: 3.0.3
info:
  title: Execute
  version: 0.1.4
servers:
  - url: https://api.riza.io
security:
  - bearerHttpAuthentication: []
paths:
  /v1/tools:
    post:
      tags:
        - Tool
      summary: Create tool
      description: Create a tool in your project.
      operationId: createTool
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateToolRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tool'
          description: OK
        '401':
          content:
            application/json:
              examples:
                unauthenticated:
                  value:
                    code: 16
                    message: unauthenticated
              schema:
                $ref: '#/components/schemas/Status'
          description: Unauthenticated error response
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Riza from '@riza-io/api';


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


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


            console.log(tool.id);
        - lang: Python
          source: |-
            import os
            from rizaio import Riza

            client = Riza(
                api_key=os.environ.get("RIZA_API_KEY"),  # This is the default and can be omitted
            )
            tool = client.tools.create(
                code="code",
                language="python",
                name="name",
            )
            print(tool.id)
        - lang: Go
          source: |
            package main

            import (
              "context"
              "fmt"

              "github.com/riza-io/riza-api-go"
              "github.com/riza-io/riza-api-go/option"
            )

            func main() {
              client := riza.NewClient(
                option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RIZA_API_KEY")
              )
              tool, err := client.Tools.New(context.TODO(), riza.ToolNewParams{
                Code: riza.F("code"),
                Language: riza.F(riza.ToolNewParamsLanguagePython),
                Name: riza.F("name"),
              })
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", tool.ID)
            }
components:
  schemas:
    CreateToolRequest:
      properties:
        code:
          description: >-
            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.
          type: string
        description:
          description: A description of the tool.
          type: string
        input_schema:
          description: >-
            The input schema of the tool. This must be a valid JSON Schema
            object.
        language:
          description: The language of the tool's code.
          enum:
            - python
            - javascript
            - typescript
          type: string
        name:
          description: The name of the tool.
          type: string
        runtime_revision_id:
          description: The ID of the runtime revision to use when executing the tool.
          type: string
      required:
        - name
        - language
        - code
      type: object
    Tool:
      properties:
        code:
          description: >-
            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.
          type: string
        description:
          description: A description of the tool.
          type: string
        id:
          description: The ID of the tool.
          type: string
        input_schema:
          description: >-
            The input schema of the tool. This must be a valid JSON Schema
            object.
        language:
          description: The language of the tool's code.
          enum:
            - python
            - javascript
            - typescript
          type: string
        name:
          description: The name of the tool.
          type: string
        revision_id:
          description: >-
            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.
          type: string
        runtime_revision_id:
          description: >-
            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.
          type: string
      required:
        - id
        - name
        - description
        - code
        - language
        - input_schema
        - revision_id
      type: object
    Status:
      properties:
        code:
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          type: integer
        message:
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
          type: string
      type: object
  securitySchemes:
    bearerHttpAuthentication:
      scheme: bearer
      type: http

````