Custom Tool Call - Messages Property? Proper form...
# support
m
Hello all. I am trying to configure a Custom Tool using the API. There is a property messages in the tool format. The documentation is worthless. ChatGPT's attempt to format failed. Claudes format failed. The VAPI Documentation agent gave me three different formats, all three failed. Can someone definitively tell me the format of this property? I want my agent to speak a line while my API Request is in-flight. Second part of the question: Where am I supposed to go to figure this out and any of the dozens of other questions. The documentation has nothing. The VAPI Documentation AI gave me three wrong answers. One of the promising links in the documentation took me to a github repo that had NOTHING to do with this.Whatis the right way to not be pestering VAPI support with basic API questions? -- Michael.
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
v
Based on the documentation I found, the "messages" property for a custom tool should define what your assistant says at different stages, such as: - **Request Start**: e.g., "Let me check that for you..." - **Request Complete**: e.g., "Here's the information you requested." - **Request Failed**: e.g., "I'm having trouble accessing the data right now." However, the exact JSON format for the "messages" property in the API is not explicitly shown in the documentation. The dashboard UI allows you to set these messages, and the API likely expects a similar structure, but a concrete example is missing. For more details, you can review the [Vapi Custom Tools documentation](https://docs.vapi.ai/tools/custom-tools) and the [troubleshooting guide](https://docs.vapi.ai/tools/custom-tools-troubleshooting). Clarifying question: Are you looking for a sample JSON payload for the "messages" property to use directly in your API request? Sources: - [Vapi Custom Tools documentation](https://docs.vapi.ai/tools/custom-tools) - [Vapi Custom Tools Troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
m
@Vapi Support Bot Support BOT. You seem to spam out useless responses. Nothing in your response looks like json for use in the API. you mention a working sample of the JSON. That would be awesome, but I can find nothing in your documentation that shows working JSON! Please reply with " a sample JSON payload for the "messages" property to use directly in my API request."
c
Here's an example you can use. It should be properly formatted:
Copy code
curl -X POST "https://api.vapi.ai/tool" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "type": "function",
    "function": {
      "name": "myCustomFunction",
      "description": "A custom function that does something useful",
      "parameters": {
        "type": "object",
        "properties": {
          "param1": {
            "type": "string",
            "description": "First parameter"
          }
        },
        "required": ["param1"]
      }
    },
    "messages": [
      {
        "type": "request-start",
        "content": "Please hold on while I process your request.",
        "blocking": false
      }
    ],
    "server": {
      "url": "https://your-server.com/webhook",
      "timeoutSeconds": 20
    }
  }'
4 Views