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

# Create Tool

> Creates a new tool for a project

## Request Body

<ParamField body="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField body="name" type="string" required>
  Tool name
</ParamField>

<ParamField body="description" type="string" required>
  Tool description
</ParamField>

<ParamField body="language" type="string" required>
  Programming language

  <Expandable title="options">
    * `javascript`
    * `python`
  </Expandable>
</ParamField>

<ParamField body="dependencies" type="array" required>
  List of dependencies
</ParamField>

<ParamField body="code" type="string" required>
  Tool code
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the operation was successful
</ResponseField>

<ResponseField name="message" type="string">
  Response message
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.yourapp.com/api/tools \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "projectId": "proj_123",
      "name": "Data Validator",
      "description": "Validates input data",
      "language": "javascript",
      "dependencies": ["lodash", "validator"],
      "code": "function validate(data) { return true; }"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.yourapp.com/api/tools', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer <token>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      projectId: 'proj_123',
      name: 'Data Validator',
      description: 'Validates input data',
      language: 'javascript',
      dependencies: ['lodash', 'validator'],
      code: 'function validate(data) { return true; }'
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.yourapp.com/api/tools"
  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }
  payload = {
      "projectId": "proj_123",
      "name": "Data Validator",
      "description": "Validates input data",
      "language": "python",
      "dependencies": ["pandas", "numpy"],
      "code": "def validate(data):\n    return True"
  }

  response = requests.post(url, json=payload, headers=headers)
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "message": "Tool created successfully"
  }
  ```

  ```json Error Response theme={null}
  {
    "success": false,
    "message": "Unauthorized"
  }
  ```
</ResponseExample>
