metadata from assistant to tool function
I'm passing metadat to my assistant metadata.sessionId. I want vapi to call a tool that uses this sessionId as a parameter.
100% of the time the tool function is called with a random value, how do i force it to use the sessionId from the metadata?
One Example:
• Call ID: 90c7ccfb-9d00-4b75-b75d-97c74822a3d6
• Timestamp: 1746309515839
• Expected Response
• Recieved Response:
Tool Config:
100% of the time the tool function is called with a random value, how do i force it to use the sessionId from the metadata?
One Example:
• Call ID: 90c7ccfb-9d00-4b75-b75d-97c74822a3d6
• Timestamp: 1746309515839
• Expected Response
{
"role": "tool_calls",
"time": 1746309515839,
"message": "",
"toolCalls": [
{
"id": "1746309515838-9g1zeofn3",
"type": "function",
"function": {
"name": "onboarding_name",
"arguments": "{\"firstName\": \"Jason\", \"sessionId\": \"9ebd66bc-d6cd-4ffc-bee6-2a152c638892\"}"
}
}
],
"secondsFromStart": 14.17
}{
"role": "tool_calls",
"time": 1746309515839,
"message": "",
"toolCalls": [
{
"id": "1746309515838-9g1zeofn3",
"type": "function",
"function": {
"name": "onboarding_name",
"arguments": "{\"firstName\": \"Jason\", \"sessionId\": \"9ebd66bc-d6cd-4ffc-bee6-2a152c638892\"}"
}
}
],
"secondsFromStart": 14.17
}• Recieved Response:
{
"role": "tool_calls",
"time": 1746309515839,
"message": "",
"toolCalls": [
{
"id": "1746309515838-9g1zeofn3",
"type": "function",
"function": {
"name": "onboarding_name",
"arguments": "{\"firstName\": \"Jason\", \"sessionId\": \"789\"}"
}
}
],
"secondsFromStart": 14.17
}{
"role": "tool_calls",
"time": 1746309515839,
"message": "",
"toolCalls": [
{
"id": "1746309515838-9g1zeofn3",
"type": "function",
"function": {
"name": "onboarding_name",
"arguments": "{\"firstName\": \"Jason\", \"sessionId\": \"789\"}"
}
}
],
"secondsFromStart": 14.17
}Tool Config:
{
"id": "c51c3cbc-720c-4665-8e41-02213a910689",
"createdAt": "2025-05-03T14:21:24.224Z",
"updatedAt": "2025-05-03T22:01:25.388Z",
"type": "function",
"function": {
"name": "onboarding_name",
"strict": false,
"description": "passes the user's name and sessionId to the homepage",
"parameters": {
"type": "object",
"properties": {
"firstName": {
"description": "User's first name",
"type": "string"
},
"sessionId": {
"description": "Session identifier",
"type": "string"
}
},
"required": [
"firstName"
]
}
},
"messages": [
{
"type": "request-start",
"content": "",
"blocking": false
}
],
"orgId": "7d9d27d3-e3a7-4f11-b129-81f322f27766",
"server": {
"url": "https://mitissa.vercel.app/api/webhook",
"headers": {}
},
"async": false
}{
"id": "c51c3cbc-720c-4665-8e41-02213a910689",
"createdAt": "2025-05-03T14:21:24.224Z",
"updatedAt": "2025-05-03T22:01:25.388Z",
"type": "function",
"function": {
"name": "onboarding_name",
"strict": false,
"description": "passes the user's name and sessionId to the homepage",
"parameters": {
"type": "object",
"properties": {
"firstName": {
"description": "User's first name",
"type": "string"
},
"sessionId": {
"description": "Session identifier",
"type": "string"
}
},
"required": [
"firstName"
]
}
},
"messages": [
{
"type": "request-start",
"content": "",
"blocking": false
}
],
"orgId": "7d9d27d3-e3a7-4f11-b129-81f322f27766",
"server": {
"url": "https://mitissa.vercel.app/api/webhook",
"headers": {}
},
"async": false
}