Setting parameters in tools
# support
f
Earlier I have added parameters in tools of vapi, and these parameters helped me using and storing dynamic variables within it. But after the new update tool function does not offer the parameters field. How can i store these variables from now on? or how can i add some parameters in my tools?
v
Hi there! 👋 You're right - the parameters field was removed in a recent update. Here's how you can still work with parameters and dynamic variables in Vapi tools: ### For Custom Tools You'll need to use the
function
structure now. Parameters should be defined within this structure:
Copy code
json
{
  "type": "function",
  "function": {
    "name": "YourFunctionNameHere",
    "parameters": {
      "param1": "value1",
      "param2": "value2"
    }
  },
  "async": false,
  "server": {
    "url": "https://your-api-endpoint"
  }
}
### For API Requests You can still add dynamic variables as query parameters in API requests using the
queryParameters
section:
Copy code
json
{
  "task": "ApiRequest",
  "method": "GET",
  "url": "https://api.example.com/data",
  "headers": {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
  },
  "queryParameters": {
    "param1": "{{dynamicValue1}}",
    "param2": "{{dynamicValue2}}"
  }
}
### Dynamic Variables via Templates For personalizing messages, you can use templates with
{{variableName}}
syntax and pass
variableValues
in the request body. Vapi now also supports [LiquidJS for dynamic variable replacement](https://docs.vapi.ai/changelog/2024/10/30), which allows more complex operations like date formatting. Hope this helps! Let me know if you need any clarification. 😊 Sources: - [Discord Query Parameters in API Requests](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344671338249453660) - [Vapi docs Custom Tools](https://docs.vapi.ai/tools/custom-tools) - [Vapi docs Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi docs Changelog](https://docs.vapi.ai/changelog/2024/10/30)
v
Message marked as helpful by @ForVapi! 🎉
k
Hey @ForVapi checking if this is resolved for you.
f
yeah, it's resolved
10 Views