# Parameters

When you configure your tool, you can define the parameters your AI model should provide. These parameters follow a [**JSON schema**](https://json-schema.org/), ensuring structured and validated inputs.

### **Define Parameters in JSON Schema**

Each parameter should include:

* **name**: The parameter's key.
* **type**: The expected data type (`string`, `number`, `boolean`, etc.).
* **description**: A brief explanation of the parameter.
* **required**: Whether the parameter is mandatory.

Here’s an example schema for the **get\_weather** tool:

```json
{
  "type": "object",
  "properties": {
    "location": {
      "type": "string",
      "description": "The name of the city or geographic coordinates for weather lookup."
    },
    "unit": {
      "type": "string",
      "enum": ["metric", "imperial"],
      "description": "The temperature unit: 'metric' for Celsius, 'imperial' for Fahrenheit."
    }
  },
  "required": ["location"],
  "additionalProperties": false,
}
```

***

### **How the AI Uses These Parameters**

When the AI calls the **get\_weather** tool, it provides values based on the defined schema. For example, the AI might generate the following request:

```json
{
  "location": "New York",
  "unit": "metric"
}
```

* If a parameter is marked as **required**, the AI will always provide it.
* Optional parameters, like `unit`, will only be included if the AI model thinks it is necessary.

***

### **Returning the Response**

Once the tool processes the request, it should return a structured response, which can also be formatted before passing it back to the AI.

{% content-ref url="/pages/Uz2fvGxXKDE5A1Tl43SB" %}
[Format response](/tools/format-response.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.chathive.app/tools/parameters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
