Dhina
02/20/2025, 7:05 PMVapi
02/21/2025, 12:46 AMserver
configuration:
/**
* This is the server that will be hit when this tool is requested by the model.
*
* All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.
*
* This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.
*/
server?: Server;
How to fix it:
1\. The tool interface only supports specific fields like async
, messages
, destinations
, etc.
2\. Custom headers need to be configured at the server level, not directly in the tool configuration.
To fix this, you should:
Add the custom header in your server configuration:
{
server: {
url: "your-url",
headers: {
"X-DBC-Message-Type": "1"
}
}
}
This is the right solution because:
1\. Server configuration is the proper place for HTTP-level customizations
2\. The tool interfaces are strictly typed to prevent unexpected configurations
3\. Headers set at the server level will be included in all requests to that endpoint