https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can I tell what parameters to use for tool cal...
# ❓・ai-evy-support
n
@AI Evy How can I tell what parameters to use for tool calls? In a function node?
a
Thanks for tagging me @neerajjoshi_. I'll look through relevant sources and get back to you shortly.
### Answer When defining parameters for tool calls in a function node, you define them using JSON schema format or JSON form [(1) ]() . For custom functions in Conversation Flow, you configure the parameters in step 6 of creating a custom function . The parameter schema uses JSON schema format . Here's an example parameter schema from the documentation :
Copy code
json
{
 "type": "object",
 "required": [
 "order_id"
 ],
 "properties": {
 "name": {
 "type": "object",
 "description": "",
 "properties": {
 "first_name": {
 "type": "string",
 "description": "User first name"
 },
 "last_name": {
 "type": "string",
 "const": "{{last_name}}"
 }
 }
 },
 "order_id": {
 "type": "number",
 "const": 1234
 }
 }
}
For guidance on structuring these parameters, you can refer to [OpenAI's Function Calling Guide]() and the [Function Calling Tutorial]() . There's also a switch to change between parameter description or const value - both description and const value can use dynamic variables . The description will be resolved by the LLM while const value will be applied directly to the function .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy how can I use dynamic variables?? In the tool calls?
a
Thanks for the follow-up, @neerajjoshi_. I'll get back to you soon.
### Answer You can use dynamic variables in tool calls by including them in tool configurations using the
{{variable_name}}
syntax [(1) ]() . Dynamic variables work in several areas of tool configurations : In Custom Function URLs In Tool Descriptions In Property Descriptions For custom functions specifically, when defining parameters, you can use dynamic variables in two ways : 1. In the description field - The LLM will resolve the variable 2. In the const value field - The value will be applied directly to the function Here's an example of using dynamic variables in a parameter schema :
Copy code
json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "object",
      "properties": {
        "last_name": {
          "type": "string",
          "const": "{{last_name}}"
        }
      }
    }
  }
}
For implementation in production: - **Outbound calls**: Set variables in the
retell_llm_dynamic_variables
field when using the Create Phone Call API - **Inbound calls**: Supply dynamic variables in the Inbound Call Webhook All values in
retell_llm_dynamic_variables
must be strings .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy How to do this for mcp node?
a
Thanks for the follow-up, @neerajjoshi_. I'll get back to you soon.
### Answer You can use dynamic variables in MCP nodes by including them in the tool configurations using the
{{variable_name}}
syntax [(1) ]() . Dynamic variables work in MCP tool configurations in these areas : - Tool descriptions - Property descriptions Steps to use dynamic variables with MCP: 1. Add your MCP connection - Connect your agent to the MCP server [(2) ]() 2. *Set request headers (optional) * - Define custom headers to include with the request Retell sends to your MCP Server 3. *Set query parameters (optional) * - Define query parameters to include in the request URL 4. Select the MCP tool from the list of available tools 5. *Set response variables (optional) * - Extract values from the MCP tool response and save them as dynamic variables for use later in the conversation For example, you can extract a user's name from the response and reference it later using
{{user_name}}
. Example response body:
Copy code
json
{
  "properties": {
    "user": {
      "name": "John Doe",
      "age": 26
    }
  }
}
For implementation in production: - **Outbound calls**: Set variables in the
retell_llm_dynamic_variables
field when using the Create Phone Call API [(1) ]() - **Inbound calls**: Supply dynamic variables in the Inbound Call Webhook All values in
retell_llm_dynamic_variables
must be strings .
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] MCP](https://docs.retellai.com/build/single-multi-prompt/mcp) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy do I have to do it in my mcp like we have zod schema and we do describe in that do we need to do describe("{{user_number}} use this excatly") like this?
a
Thanks for the follow-up, @neerajjoshi_. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] MCP](https://docs.retellai.com/build/single-multi-prompt/mcp) [[2] Connect any AI Voice Agent to MCP with Retell AI MCP Node (Guide) | Retell AI](https://www.retellai.com/blog/connect-any-ai-voice-agent-to-mcp-with-retell-ai-mcp-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer No, you don't need to modify your MCP server's Zod schema to include dynamic variables like
{{user_number}}
in the descriptions [(1) ]() . Dynamic variables are handled on the Retell AI side, not in your MCP server code [(1) ]() [(2) ]() . When you configure the MCP node in Retell AI, you can: 1. Set query parameters - Define query parameters that include dynamic variables using the
{{variable_name}}
syntax 2. Set request headers - Include dynamic variables in custom headers 3. Set response variables - Extract values from the MCP tool response and save them as dynamic variables Your MCP server's Zod schema should define the tool parameters normally, without dynamic variable syntax [(1) ]() . The dynamic variable substitution happens when Retell AI calls your MCP server, not within the MCP server itself [(2) ]() . For example, in the Retell AI dashboard when configuring your MCP node, you might set a query parameter with a value like
{{user_number}}
, and Retell AI will replace that with the actual value before sending the request to your MCP server [(1) ]() [(2) ]() .