curl --request POST \
--url https://api.agents.slng.ai/v1/agents/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "lookup_customer",
"tool_type": "code",
"description": "Look up a customer by id and region",
"code_src": "from pydantic import BaseModel\n\nclass Input(BaseModel):\n customer_id: str\n region: str\n\nclass Output(BaseModel):\n customer_id: str\n region: str\n\ndef handler(input: Input) -> Output:\n return Output(\n customer_id=input.customer_id,\n region=input.region,\n )\n",
"config": {
"type": "code"
},
"declared_secrets": [
"CRM_API_KEY"
],
"dependencies": [
"requests==2.32.3"
],
"argument_defaults": {
"region": "{{$DEFAULT_REGION}}"
}
}
'{
"id": "7b2a1c34-5d6e-4f70-8a90-1b2c3d4e5f60",
"organisation_id": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
"name": "lookup_customer",
"tool_type": "api_request",
"config": {
"type": "api_request",
"url": "https://api.example.com/lookup",
"http_method": "POST"
},
"description": "Look up a customer by id",
"declared_secrets": [],
"dependencies": [],
"argument_defaults": {},
"code_src": null,
"last_run_status": "succeeded",
"source": "org",
"latest_version": 3,
"content_hash": "3f1ab2c4d5e6f708",
"is_current_hash_green": true,
"is_current_version": true,
"schema_stale": false,
"gate_status": {
"static": {
"config_valid": {
"passed": true
},
"secrets_exist": {
"passed": true
},
"name_unique": {
"passed": true
}
},
"green_run": {
"passed": true
}
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}Create Tool
Create an organisation tool draft from one of eight tool types. Curated capability types are rejected, the code type needs the code-tools feature, and managed singleton types (send_sms, transfer_call, end_call) return the existing instance instead of a duplicate. Returns 201 with the new draft.
curl --request POST \
--url https://api.agents.slng.ai/v1/agents/tools \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "lookup_customer",
"tool_type": "code",
"description": "Look up a customer by id and region",
"code_src": "from pydantic import BaseModel\n\nclass Input(BaseModel):\n customer_id: str\n region: str\n\nclass Output(BaseModel):\n customer_id: str\n region: str\n\ndef handler(input: Input) -> Output:\n return Output(\n customer_id=input.customer_id,\n region=input.region,\n )\n",
"config": {
"type": "code"
},
"declared_secrets": [
"CRM_API_KEY"
],
"dependencies": [
"requests==2.32.3"
],
"argument_defaults": {
"region": "{{$DEFAULT_REGION}}"
}
}
'{
"id": "7b2a1c34-5d6e-4f70-8a90-1b2c3d4e5f60",
"organisation_id": "0a1b2c3d-4e5f-6071-8293-a4b5c6d7e8f9",
"name": "lookup_customer",
"tool_type": "api_request",
"config": {
"type": "api_request",
"url": "https://api.example.com/lookup",
"http_method": "POST"
},
"description": "Look up a customer by id",
"declared_secrets": [],
"dependencies": [],
"argument_defaults": {},
"code_src": null,
"last_run_status": "succeeded",
"source": "org",
"latest_version": 3,
"content_hash": "3f1ab2c4d5e6f708",
"is_current_hash_green": true,
"is_current_version": true,
"schema_stale": false,
"gate_status": {
"static": {
"config_valid": {
"passed": true
},
"secrets_exist": {
"passed": true
},
"name_unique": {
"passed": true
}
},
"green_run": {
"passed": true
}
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}Authorizations
Your SLNG consumer API key.
Body
The tool draft to create.
- Custom Code
- API Request
- End Call
- Voicemail Detection
- Transfer Call
- Send SMS
- Current Date and Time
- User Phone Number
Run sandboxed Python you provide. Custom code has no internet access.
1 - 200^[A-Za-z0-9_-]+$2000Default values for the tool arguments, keyed by argument name. Each value is a literal (string, number, or boolean) or a Vault variable reference using the {{$NAME}} syntax. Applied when a caller does not supply that argument. The keys are the argument names the tool declares; the shape is the same for every tool type.
"code"Configuration for a Custom Code tool. Custom code runs sandboxed with no internet access.
Show child attributes
Show child attributes
The Python source for the tool. Only used by Custom Code tools and ignored for other tool types. Custom Code runs sandboxed with no internet access.
Names of Vault secrets the code may read at runtime.
Python package dependencies to install for the code, as exact pinned specifiers.
Response
The newly created organisation tool.
A tool and its current draft state, including config, publish gates, and version info.
Vault secret names this tool is allowed to read at runtime.
Pinned Python package dependencies installed for this tool.
curated tools are built in and maintained by SLNG; org tools were created by your organisation.
curated, org Gate set is selected by tool_type (V2): data → static + green_run; code also reports config_valid; ctx-bound → config_valid ONLY.
Show child attributes
Show child attributes
code, api_request, end_call, voicemail_detection, transfer_call, send_sms, current_datetime, user_phone_number Configuration for a Custom Code tool. Custom code runs sandboxed with no internet access.
- CodeConfig
- ApiRequestConfig
- EndCallConfig
- VoicemailDetectionConfig
- TransferCallConfig
- SendSmsConfig
- CurrentDatetimeConfig
- UserPhoneNumberConfig
Show child attributes
Show child attributes
Current default values for the tool arguments, keyed by argument name. Each value is a literal (string, number, or boolean) or a Vault variable reference using the {{$NAME}} syntax. Applied when a caller does not supply that argument.
Current Python source for the tool, populated for Custom Code tools only. Custom Code runs sandboxed with no internet access.