> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rasen.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rasen.ai/_mcp/server.

# Validate a tool definition

POST https://api.rasen.ai/v1/agents/{agent_id}/tools/validate
Content-Type: application/json

Schema/reference validation only. No remote webhook, discovery or tool execution; a valid result is not an end-to-end tool test. Reserved names end\_call, transfer and transfer\_to\_number are refused with invalid\_request on every write/validation; use default\_tools. Inline credential material also requires secrets.manage, because it creates a secret; a \{secret\_id, version} reference also requires secrets.read. It checks the definition as a new tool of the draft: an omitted timing is during\_call, also when the agent already has a before-call tool. Send timing pre\_call to check a before-call tool: its rules answer as on createAgentTool, and an agent that already has one reports tool\_pre\_call\_exists.

Reference: https://docs.rasen.ai/enterprise/api-reference/agents/tools/validate

## Authentication

- `Authorization` header (bearer token, required) — An organisation-owned key whose secret starts ra_org_. The Owner or an Admin of an organisation that Rasen has invited makes it in the app; no API operation makes, changes, rotates or revokes a key. On a workspace operation send the workspace ID in the Rasen-Workspace header; without it the answer is 400 invalid_request with details.field Rasen-Workspace. A workspace outside the organisation or outside the key's workspace list is 404 not_found. An organisation that is not invited gets 403 organisation_api_not_enabled.

## Request

### Path parameters

- `agent_id` (string, required) — Resource identity within the authenticated workspace.

### Headers

- `Rasen-Workspace` (string, required) — The ID of the workspace that this operation acts in. It must be a workspace of the key's organisation and in the key's workspace list. A missing, empty or malformed value is 400 invalid_request with details.field Rasen-Workspace; a workspace outside the organisation or the key's workspace list is the hidden 404 not_found.

### Body (application/json)

This endpoint expects a ToolWrite.

- `ToolWrite`
  - `kind`: `webhook` (webhook)
    - `definition` (WebhookDefinition, required) — Public HTTPS destination; platform egress policy rejects private/metadata addresses and unsafe redirects at write and execution. No credentials in URL.
    - `description` (string, required)
    - `name` (string, required)
    - `retry_posture` (enum, required)
      - Allowed values: `none`, `automatic`
    - `side_effect` (enum, required)
      - Allowed values: `none`, `idempotent`, `unknown`
    - `deadline_ms` (integer, optional, default: 8000) — Milliseconds the tool may take. Omitted: 8000 for a during-call tool, 3000 for a before-call tool (timing pre_call), which allows 500 to 10000. A value outside 100 to 30000 is 400 invalid_request for every tool; inside it but outside 500 to 10000 on a before-call tool is 422 tool_pre_call_bounds.
    - `effect_id_name` (string, optional)
    - `effect_id_placement` (enum, optional)
      - Allowed values: `header`, `body`
    - `max_response_bytes` (integer, optional, default: 32768) — Largest response body the tool may return. Omitted: 32768 for a during-call tool, 4096 for a before-call tool (timing pre_call), which allows at most 4096. A value outside 256 to 65536 is 400 invalid_request for every tool; inside it but above 4096 on a before-call tool is 422 tool_pre_call_bounds.
    - `timing` (enum, optional) — When the tool runs. during\_call: the model calls it during the call. pre\_call: the agent's before-call tool. On an inbound call the platform sends its request one time while the phone rings, before it answers the call; it does not run on outbound or browser test calls. Omitted on create: during\_call. Omitted on replace: the tool keeps its stored timing. A before-call tool obeys these rules: one for each agent (tool\_pre\_call\_exists); a webhook only; each parameter source is constant or dynamic\_variable, because no model runs before the call (tool\_pre\_call\_llm\_parameter); side\_effect none and retry\_posture none, so it is a lookup with no automatic retry (tool\_pre\_call\_side\_effect); deadline\_ms 500 to 10000, default 3000, and max\_response\_bytes at most 4096, default 4096, and wait\_for\_response true (tool\_pre\_call\_bounds; a limit outside the schema bounds of every tool, 100 to 30000 ms or 256 to 65536 bytes, is 400 invalid\_request first); a name that is not an agent variable, agent\_name or language and does not start with system\_\_ (tool\_pre\_call\_name). The response body goes into the system prompt as data, at the \{\{\<tool name>}} placeholder or at the end of the prompt. The first message can name one field of it with a fallback: \{\{\<tool name>.\<path>|\<fallback>}}. A slow or failed request does not stop the call: the agent answers without the data.
      - Allowed values: `during_call`, `pre_call`
    - `wait_for_response` (boolean, optional, default: true)
  - `kind`: `mcp` (mcp)
    - `definition` (McpDefinition, required)
    - `description` (string, required)
    - `name` (string, required)
    - `retry_posture` (enum, required)
      - Allowed values: `none`, `automatic`
    - `side_effect` (enum, required)
      - Allowed values: `none`, `idempotent`, `unknown`
    - `deadline_ms` (integer, optional, default: 8000)
    - `max_response_bytes` (integer, optional, default: 32768)
    - `wait_for_response` (boolean, optional, default: true)

## Response

### 200

Validate a tool definition.

- `valid` (boolean, required)
- `errors` (list of ValidationIssue, required)
- `warnings` (list of ValidationIssue, required)
- `readiness` (Readiness, required) — A snapshot, not a reservation. Admission rechecks current readiness. Publication, model support, knowledge and phone routing are separate prerequisites. Reasons can include credential_unavailable when the live version has tools that pin a revoked credential version.

## Errors

### 400 Bad Request Error

Invalid input or cursor. Correct the request.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 401 Unauthorized Error

Invalid, expired or revoked API key. Creator departure or membership changes do not invalidate a workspace key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 403 Forbidden Error

Operation not allowed by current credential or workspace access.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 404 Not Found Error

Resource absent or not visible in this workspace.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 409 Conflict Error

Conflict. Not retryable: read the current state, fix the request and send a new request. The one exception is idempotency_in_progress, which carries Retry-After: wait, then resend the identical request with the same Idempotency-Key. The operation lists its codes in x-error-codes; branch on error.code and, for conflict, error.details.reason.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 413 Content Too Large Error

Body or upload exceeds its allowed limit.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 422 Unprocessable Entity Error

The request is well formed but refused, for example a destination that is not a permitted public address.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 429 Too Many Requests Error

Rate limited. Respect Retry-After and retry the same intent where permitted.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 500 Internal Server Error

Internal error. The effect may have happened. Retry the same request with the same Idempotency-Key; read the resource before creating a new intent. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 503 Service Unavailable Error

Service unavailable. Respect Retry-After where present. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

## Types

### WebhookDefinition

Public HTTPS destination; platform egress policy rejects private/metadata addresses and unsafe redirects at write and execution. No credentials in URL.

- `url` (string, required)
- `method` (enum, required)
  - Allowed values: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`
- `headers` (list of ToolHeader, optional)
- `parameters` (list of ToolParameter, optional)
- `content_type` (enum, optional, default: application/json)
  - Allowed values: `application/json`, `application/x-www-form-urlencoded`

### McpDefinition

- `server_id` (string, required) — Opaque mcp identifier. Do not parse its contents.
- `remote_tool_name` (string, required)
- `schema_digest` (string, required)

### ValidationIssue

- `field` (string, required)
- `code` (string, required)
- `message` (string, required)

### Readiness

A snapshot, not a reservation. Admission rechecks current readiness. Publication, model support, knowledge and phone routing are separate prerequisites. Reasons can include credential_unavailable when the live version has tools that pin a revoked credential version.

- `state` (string, required) — Open response vocabulary. Preserve unknown values; never assume they mean success.
- `reasons` (list of ReadinessReasonsItems, required)

### ErrorResponseError

Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

- `code` (string, required) — Stable code. Branch on code (and details.reason for conflict), never on message. Each code has one HTTP status; see components.x-error-catalog.
- `message` (string, required) — Safe description; no provider payload or submitted secrets.
- `details` (map from string to any, optional) — Safe code-specific details. The public fields for each code are listed in components.x-error-catalog. Details never contain a request fingerprint, a hash of a request, secret material or another tenant's data. forbidden may include required_capabilities (a list).
- `request_id` (string, optional) — Same value as the X-Request-Id header. Quote it to support.
- `retry` (string, optional) — Retry class of this code: no (fix the request or state first), yes (retry the same request and the same Idempotency-Key), retry_after (wait for Retry-After, then retry the same request). Open response vocabulary. Preserve unknown values; never assume they mean success.

### ToolHeader

secret requires credential; dynamic_var requires variable. Credential may be a safe existing reference or inline write-only material. On full tool replacement, a secret header with the same case-insensitive name can omit credential to retain its binding. New secret headers require a credential. Header omission removes that binding from the draft. Values never return.

- `name` (string, required)
- `value_type` (enum, required)
  - Allowed values: `secret`, `dynamic_var`
- `credential` (CredentialInput, optional) — Exactly one of: an existing reference \{secret\_id, version} to an active version of a secret with the matching purpose, or new write-only inline material. No mixed shape. A reference to a revoked, deleted or wrong-purpose version refuses with credential\_unavailable. References pin the exact version and never follow rotation.
- `variable` (string, optional)

### ToolParameter

- `name` (string, required)
- `location` (enum, required)
  - Allowed values: `path`, `query`, `body`
- `source` (enum, required) — Where the value comes from. A group or a list has source model and no value; its fields have their own source.
  - Allowed values: `model`, `constant`, `dynamic_variable`
- `schema` (ToolParameterSchema, required) — The JSON Schema of the value. A group (object) or a list (array) carries only type and description; its shape is in fields or items.
- `value` (ToolParameterValue, optional) — Constant scalar or dynamic variable name; omit for model parameters. Null constant is not accepted.
- `required` (boolean, optional, default: false)
- `fields` (list of ToolParameter, optional) — The fields of a group (schema.type object). Each field is a parameter with location body. Only on a group. A nested body needs content_type application/json; a tool holds at most 5 levels and 64 values in total.
- `items` (ToolParameterItems, optional) — The shape of one item of a list (schema.type array): one value that the model fills, or a group of fields. A list needs at least one value that the model fills.
- `when_empty` (enum, optional) — Only on an optional body value that the model fills. Omitted: a value the model leaves out is not sent. null: the key is sent with JSON null.
  - Allowed values: `null`

### ReadinessReasonsItems

- `code` (string, required) — Registered refusal or capability reason.
- `message` (string, required) — Safe next step for the integrator.

### CredentialInput

Exactly one of: an existing reference \{secret\_id, version} to an active version of a secret with the matching purpose, or new write-only inline material. No mixed shape. A reference to a revoked, deleted or wrong-purpose version refuses with credential\_unavailable. References pin the exact version and never follow rotation.

- SecretReference: SecretReference
- InlineCredential: InlineCredential

### ToolParameterSchema

The JSON Schema of the value. A group (object) or a list (array) carries only type and description; its shape is in fields or items.

- `type` (enum, required)
  - Allowed values: `string`, `number`, `integer`, `boolean`, `object`, `array`
- `enum` (list of ToolParameterSchemaEnumItems, optional)
- `description` (string, optional)
- `minimum` (double, optional)
- `maximum` (double, optional)

### ToolParameterValue

Constant scalar or dynamic variable name; omit for model parameters. Null constant is not accepted.

- string
- double
- boolean

### ToolParameterItems

The shape of one item of a list (schema.type array): one value that the model fills, or a group of fields. A list needs at least one value that the model fills.

- `schema` (ToolParameterItemsSchema, required) — The JSON Schema of one item: a value that the model fills, or object for a group of fields. A list cannot hold a list.
- `fields` (list of ToolParameter, optional) — The fields of each item when the item is a group (schema.type object).

### SecretReference

Pinned reference to one exact credential version. Never follows rotation: to adopt a new version, replace the tool or MCP server with the new version, then publish each affected agent. No secret material in responses.

- `secret_id` (string, required) — Opaque sec identifier. Do not parse its contents.
- `version` (integer, required)

### InlineCredential

Write-only credential material for one-off setup. Never returned, logged or included in diffs. It creates a new secret at version 1 (purpose from the consumer) and binds that exact version; the secret then appears in GET /secrets. For declarative or repeated setup, do not re-send inline material: look up or create the secret with POST /secrets and a resource\_key, then send a \{secret\_id, version} reference. Each inline apply creates another secret; with a resource\_key that exists it returns 409 resource\_key\_conflict with details.existing\_id instead.

- `value` (string, required)
- `material_kind` (enum, required) — A descriptive label that does not change how the value is sent. Rasen sends the stored value unchanged as the header value for a webhook secret header, or as "Bearer \<value>" for an MCP server with auth=bearer, or as the header value for auth=secret\_header. For basic\_auth, store the complete header value, for example "Basic \<base64 of user:password>", and use a secret header named Authorization. No kind and auth-mode pair is refused.
  - Allowed values: `api_key`, `bearer_token`, `basic_auth`
- `name` (string, optional) — Optional secret handle for the created secret.
- `resource_key` (string, optional) — Optional caller-chosen resource key: an opaque external identifier that matches your own record (for example a CRM ID, a configuration-file ID or a UUID) to this resource. Rasen still generates the canonical id; use id in paths and references. Case-sensitive, compared exactly, never normalized or parsed. 1-128 characters from A-Z a-z 0-9 . _ : ~ - and starting with a letter or digit; UUIDs and ULIDs are valid. Unique per resource type within one workspace; separate environment workspaces can reuse the same key. Set only at creation and immutable afterwards. A create with a key that already exists returns 409 resource_key_conflict with details.existing_id; it never updates or returns the existing resource. Not an Idempotency-Key: that header identifies one request intent for 24 hours, and a same-intent replay returns its original receipt before the resource-key check runs. Uniqueness includes archived resources. A key becomes free again only after its resource is permanently deleted or erased (a deleted secret or a deleted knowledge source); archive never frees it.

### ToolParameterSchemaEnumItems

- string
- double
- boolean

### ToolParameterItemsSchema

The JSON Schema of one item: a value that the model fills, or object for a group of fields. A list cannot hold a list.

- `type` (enum, required)
  - Allowed values: `string`, `number`, `integer`, `boolean`, `object`
- `enum` (list of ToolParameterItemsSchemaEnumItems, optional)
- `description` (string, optional)
- `minimum` (double, optional)
- `maximum` (double, optional)

### ToolParameterItemsSchemaEnumItems

- string
- double
- boolean

## Examples

**Request**

```json
{
  "kind": "webhook",
  "definition": {
    "url": "https://api.example.com/orders/{order_id}",
    "method": "GET",
    "headers": [
      {
        "name": "Authorization",
        "value_type": "secret",
        "credential": {
          "secret_id": "sec_01j00000000000000000000000",
          "version": 2
        }
      }
    ],
    "parameters": [
      {
        "name": "order_id",
        "location": "path",
        "source": "model",
        "schema": {
          "type": "string",
          "description": "Order ID said by the caller."
        },
        "required": true
      }
    ]
  },
  "description": "Look up an order by its ID.",
  "name": "lookup_order",
  "retry_posture": "none",
  "side_effect": "none"
}
```

**Response**

```json
{
  "valid": true,
  "errors": [
    {
      "field": "example",
      "code": "example",
      "message": "Assign an outbound number to this agent."
    }
  ],
  "warnings": [
    {
      "field": "example",
      "code": "example",
      "message": "Assign an outbound number to this agent."
    }
  ],
  "readiness": {
    "state": "ready",
    "reasons": [
      {
        "code": "example",
        "message": "Assign an outbound number to this agent."
      }
    ]
  }
}
```

**SDK Code**

```python agents_tools_validate_example
import requests

url = "https://api.rasen.ai/v1/agents/agent_id/tools/validate"

payload = {
    "kind": "webhook",
    "definition": {
        "url": "https://api.example.com/orders/{order_id}",
        "method": "GET",
        "headers": [
            {
                "name": "Authorization",
                "value_type": "secret",
                "credential": {
                    "secret_id": "sec_01j00000000000000000000000",
                    "version": 2
                }
            }
        ],
        "parameters": [
            {
                "name": "order_id",
                "location": "path",
                "source": "model",
                "schema": {
                    "type": "string",
                    "description": "Order ID said by the caller."
                },
                "required": True
            }
        ]
    },
    "description": "Look up an order by its ID.",
    "name": "lookup_order",
    "retry_posture": "none",
    "side_effect": "none"
}
headers = {
    "Rasen-Workspace": "ws_01j00000000000000000000000",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript agents_tools_validate_example
const url = 'https://api.rasen.ai/v1/agents/agent_id/tools/validate';
const options = {
  method: 'POST',
  headers: {
    'Rasen-Workspace': 'ws_01j00000000000000000000000',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"kind":"webhook","definition":{"url":"https://api.example.com/orders/{order_id}","method":"GET","headers":[{"name":"Authorization","value_type":"secret","credential":{"secret_id":"sec_01j00000000000000000000000","version":2}}],"parameters":[{"name":"order_id","location":"path","source":"model","schema":{"type":"string","description":"Order ID said by the caller."},"required":true}]},"description":"Look up an order by its ID.","name":"lookup_order","retry_posture":"none","side_effect":"none"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```ruby agents_tools_validate_example
require 'uri'
require 'net/http'

url = URI("https://api.rasen.ai/v1/agents/agent_id/tools/validate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Rasen-Workspace"] = 'ws_01j00000000000000000000000'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"kind\": \"webhook\",\n  \"definition\": {\n    \"url\": \"https://api.example.com/orders/{order_id}\",\n    \"method\": \"GET\",\n    \"headers\": [\n      {\n        \"name\": \"Authorization\",\n        \"value_type\": \"secret\",\n        \"credential\": {\n          \"secret_id\": \"sec_01j00000000000000000000000\",\n          \"version\": 2\n        }\n      }\n    ],\n    \"parameters\": [\n      {\n        \"name\": \"order_id\",\n        \"location\": \"path\",\n        \"source\": \"model\",\n        \"schema\": {\n          \"type\": \"string\",\n          \"description\": \"Order ID said by the caller.\"\n        },\n        \"required\": true\n      }\n    ]\n  },\n  \"description\": \"Look up an order by its ID.\",\n  \"name\": \"lookup_order\",\n  \"retry_posture\": \"none\",\n  \"side_effect\": \"none\"\n}"

response = http.request(request)
puts response.read_body
```

```java agents_tools_validate_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.rasen.ai/v1/agents/agent_id/tools/validate")
  .header("Rasen-Workspace", "ws_01j00000000000000000000000")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"kind\": \"webhook\",\n  \"definition\": {\n    \"url\": \"https://api.example.com/orders/{order_id}\",\n    \"method\": \"GET\",\n    \"headers\": [\n      {\n        \"name\": \"Authorization\",\n        \"value_type\": \"secret\",\n        \"credential\": {\n          \"secret_id\": \"sec_01j00000000000000000000000\",\n          \"version\": 2\n        }\n      }\n    ],\n    \"parameters\": [\n      {\n        \"name\": \"order_id\",\n        \"location\": \"path\",\n        \"source\": \"model\",\n        \"schema\": {\n          \"type\": \"string\",\n          \"description\": \"Order ID said by the caller.\"\n        },\n        \"required\": true\n      }\n    ]\n  },\n  \"description\": \"Look up an order by its ID.\",\n  \"name\": \"lookup_order\",\n  \"retry_posture\": \"none\",\n  \"side_effect\": \"none\"\n}")
  .asString();
```

```php agents_tools_validate_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.rasen.ai/v1/agents/agent_id/tools/validate', [
  'body' => '{
  "kind": "webhook",
  "definition": {
    "url": "https://api.example.com/orders/{order_id}",
    "method": "GET",
    "headers": [
      {
        "name": "Authorization",
        "value_type": "secret",
        "credential": {
          "secret_id": "sec_01j00000000000000000000000",
          "version": 2
        }
      }
    ],
    "parameters": [
      {
        "name": "order_id",
        "location": "path",
        "source": "model",
        "schema": {
          "type": "string",
          "description": "Order ID said by the caller."
        },
        "required": true
      }
    ]
  },
  "description": "Look up an order by its ID.",
  "name": "lookup_order",
  "retry_posture": "none",
  "side_effect": "none"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Rasen-Workspace' => 'ws_01j00000000000000000000000',
  ],
]);

echo $response->getBody();
```

```csharp agents_tools_validate_example
using RestSharp;

var client = new RestClient("https://api.rasen.ai/v1/agents/agent_id/tools/validate");
var request = new RestRequest(Method.POST);
request.AddHeader("Rasen-Workspace", "ws_01j00000000000000000000000");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"kind\": \"webhook\",\n  \"definition\": {\n    \"url\": \"https://api.example.com/orders/{order_id}\",\n    \"method\": \"GET\",\n    \"headers\": [\n      {\n        \"name\": \"Authorization\",\n        \"value_type\": \"secret\",\n        \"credential\": {\n          \"secret_id\": \"sec_01j00000000000000000000000\",\n          \"version\": 2\n        }\n      }\n    ],\n    \"parameters\": [\n      {\n        \"name\": \"order_id\",\n        \"location\": \"path\",\n        \"source\": \"model\",\n        \"schema\": {\n          \"type\": \"string\",\n          \"description\": \"Order ID said by the caller.\"\n        },\n        \"required\": true\n      }\n    ]\n  },\n  \"description\": \"Look up an order by its ID.\",\n  \"name\": \"lookup_order\",\n  \"retry_posture\": \"none\",\n  \"side_effect\": \"none\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift agents_tools_validate_example
import Foundation

let headers = [
  "Rasen-Workspace": "ws_01j00000000000000000000000",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "kind": "webhook",
  "definition": [
    "url": "https://api.example.com/orders/{order_id}",
    "method": "GET",
    "headers": [
      [
        "name": "Authorization",
        "value_type": "secret",
        "credential": [
          "secret_id": "sec_01j00000000000000000000000",
          "version": 2
        ]
      ]
    ],
    "parameters": [
      [
        "name": "order_id",
        "location": "path",
        "source": "model",
        "schema": [
          "type": "string",
          "description": "Order ID said by the caller."
        ],
        "required": true
      ]
    ]
  ],
  "description": "Look up an order by its ID.",
  "name": "lookup_order",
  "retry_posture": "none",
  "side_effect": "none"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.rasen.ai/v1/agents/agent_id/tools/validate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```