Code Tool Validation Bug: ‘Invalid literal value, ...
# support
g
POST THIS IN #1211483291191083018 Hi team — I'm experiencing a persistent Code Tool validation error in the dashboard: "Invalid literal value, expected 'object'" No matter what I enter in the configuration, the Save button is blocked and the warning appears. I have already tried: • Removing the description • Rewriting it as plain text • Rebuilding the code tool • Recreating environment variables • Using a fully empty description • Deleting and re-creating Zapier + Notion steps Nothing resolves the issue. Here is what I believe is happening: The UI validator is incorrectly rejecting the tool schema before save, even though all fields (parameters, env vars, TypeScript code) are filled correctly. It behaves as if an internal field in the JSON config expects an object but the UI is injecting a string literal. Would you be able to check my tool config on the backend? My tool ID: bd0104be-49e1-4b48-93e9-6eba205ec2ed Org: randy@gibbsx.com ’s Org Happy to provide screenshots, console logs, or a screen recording if needed. Thanks!
v
To escalate this dashboard validation bug, please submit a detailed issue report as outlined in the [Vapi issue reporting guide](https://docs.vapi.ai/issue-reporting). Include your tool ID, organization, browser info, steps to reproduce, and—if possible—a screen recording or console error. Here’s a quick template:
Copy code
Tool ID: bd0104be-49e1-4b48-93e9-6eba205ec2ed
Org: randy@gibbsx.com
Browser: [Your browser/version]
Steps: [List steps to reproduce]
Screen recording: [link or attach]
Console errors: [paste any errors]
This will help the support team investigate and resolve the issue efficiently. Source: - [How to Report Issues Effectively](https://docs.vapi.ai/issue-reporting)
g
Tool ID: bd0104be-49e1-4b48-93e9-6eba205ec2ed Org: randy@gibbsx.com Browser: Chrome Version 120.0.6099.225 (Windows 11) URL: https://dashboard.vapi.ai/tools/bd0104be-49e1-4b48-93e9-6eba205ec2ed Steps to reproduce: Open the Code Tool configuration page. Enter any valid description (or leave blank). Add environment variable WEBHOOK_URL. Add simple parameters (all strings). Paste valid TypeScript code using args and env. Try to click Save → Save button disappears. UI displays: “Invalid literal value, expected 'object'”. Removing description, parameters, or code does not resolve it. Issue persists even after deleting and fully recreating the tool. Expected behavior: The tool should save normally when all required fields (name, description, parameters, env vars, code) are valid. Actual behavior: The UI rejects the tool before save, showing the validation error. It behaves as if an internal field in the tool schema expects an object but is receiving a string literal injected by the UI. Screen recording: Will provide if needed (issue is 100% reproducible every time). Console errors: (Please press F12 > Console and copy/paste whatever appears when clicking Save. If nothing appears, just reply with “No console errors visible.”) Here is the code I get: Form has validation errors: Invalid literal value, expected "object" Expected number, received nan Click the warning icon to run full validation https://cdn.discordapp.com/attachments/1448399940593254543/1448403029819789324/image.png?ex=693b21f0&is=6939d070&hm=f90edba2c004325b404ccf19871227d806dc0313e079de0a624285341fb04d77&
Here is the console output you requested. I also confirmed that the error persists even after deleting and recreating the tool. The Save button still does not appear. Please let me know if you need a screen recording. I'm ready to provide anything needed to help debug the UI validator issue. Thanks!
m
Having same exact issue
seems the parameter schema in the UI is not correctly formatting as an object
c
Hi GibbsX, It seems you are encountering a common issue related to parameter schema validation in the Code Tool setup. Here are some steps you can try to address the "Invalid literal value, expected 'object'" error: 1. **Ensure Parameter Schema Format**: Make sure your parameters are defined in the following structure:
Copy code
json
   {
     "type": "object",
     "properties": {
       "callername": { "type": "string" },
       "phonenumber": { "type": "string" },
       "email": { "type": "string" },
       // Add other parameters accordingly
     },
     "required": ["callername", "phonenumber", "email"] // Add required fields
   }
2. **Double-Check Configuration**: Verify that each parameter and environment variable is correctly entered in the UI. Parameters should not be nested. 3. **Clear Browser Cache or Use Incognito Mode**: Sometimes, caching issues can affect UI behavior. Try clearing your browser cache or using an incognito window to see if the problem persists. 4. **Use a JSON Validator**: Validate the JSON structure you're setting up to ensure there are no hidden errors or typos, as these can lead to validation issues. 5. **Try Using the API**: As a workaround, consider using the Vapi API to configure your tool directly. This might bypass UI-specific validation errors. 6. **Report a Detailed Issue**: Follow the [Vapi issue reporting guide](https://docs.vapi.ai/issue-reporting) to report this issue with detailed steps and console logs, which can help support teams address the bug efficiently. These steps should help address the problem. If the issue persists, continue providing detailed error logs and configurations to Vapi support to help expedite a solution.