#You can add a schema definitions, so Elevenlabs can properly understand the arrays
1 messages · Page 1 of 1 (latest)
Short answer: The official docs show where to provide schemas for tools, but they do not document array-specific schema keywords (for example, type: "array", items) or support for JSON Schema “definitions”/$defs. Therefore I can’t confirm from the documentation that array handling or schema definitions are supported.
What is documented:
- When creating/updating a server (webhook) tool, you provide tool_config.api_schema with path_params_schema, query_params_schema, and request_body_schema, which are JSON‑schema–style objects using keys like type, properties, and required. The docs don’t include guidance or examples for arrays. (elevenlabs.io)
- The Server tools guide explains that these schemas inform how the assistant constructs requests, but it also doesn’t specify array handling or JSON Schema definitions. (elevenlabs.io)
If you can share the exact endpoint and the array you need to pass, I can look for any product-specific notes or test patterns in the docs.
Sources:
Update tool | ElevenLabs Documentation
Server tools | ElevenLabs Documentation
I get that, but what I dont get is on how to declare two objects (as items) inside of the same array?
Or to declare something more simple as:
"properties": [
"phone",
"mobilephone"
],
Cause by the client SDK, typescript won't allow me to push two items of string, for example:
properties: {
"type": "array",
"items": {
"type": "string",
"constantValue": ["phone", "mobilephone"],
}
}
how should I do it?
Short answer: model them as named fields, not as an enum array. In ElevenLabs tool schemas, properties is an object (a map of field names to schemas), not a list. The docs only show type, properties, and required for request_body_schema/query_params_schema; there is no documented constantValue keyword.
Example that matches the docs:
{
"tool_config": {
"api_schema": {
"method": "POST",
"url": "https://example.com/your-endpoint",
"request_body_schema": {
"type": "object",
"required": ["phone", "mobilephone"],
"properties": {
"phone": { "type": "string" },
"mobilephone": { "type": "string" }
}
}
}
}
}
Why:
- request_body_schema is an object with properties (map), and required is an array of property names. The docs do not document enum/const or constantValue for tool schemas. Trying to use constantValue (or pushing multiple const items) won’t type-check in the SDK because it isn’t part of the published schema. (elevenlabs.io)
If you genuinely need an array of strings (not two named fields), the only documented pattern is:
"properties": {
"properties": {
"type": "array",
"items": { "type": "string" }
}
}
and then enforce allowed values on your webhook/server, since platform-side validation of enumerated array values isn’t documented. (elevenlabs.io)
If you were trying to declare “two objects as items inside the same array” (tuple validation), that’s not described in the tool schema docs; stick to the object-with-named-fields pattern above. (elevenlabs.io)
Sources:
Create tool | ElevenLabs Documentation
Server tools | ElevenLabs Documentation
Create tool | ElevenLabs Documentation
okay, but when the array contains objects, how to declare two sequential objects?
i have declared the first object:
filterGroups: {
type: "array",
items: {
type: "object",
properties: {
filters: {
type: "array",
items: {
type: "object",
properties: {
propertyName: {
type: "string",
constantValue: "phone",
},
operator: {
type: "string",
constantValue: "CONTAINS_TOKEN"
},
value: {
type: "string",
dynamicVariable: "*system__caller_id"
}
}
}
}
}
}
},
but didnt manage to declare the second since 'items' only accept one single object, not two.. while 'properties' require me to put a 'string' name for the key