docs: make the complete tool configuration template a valid payload - #1210
Open
chiranjeet-vapi wants to merge 2 commits into
Open
docs: make the complete tool configuration template a valid payload#1210chiranjeet-vapi wants to merge 2 commits into
chiranjeet-vapi wants to merge 2 commits into
Conversation
The custom tools troubleshooting page told readers to set maxTokens on a tool, in three code blocks and in the debugging table. The API has no such field, so pasting the page's own example back returns 400: POST https://api.vapi.ai/assistant {"message":["model.each value in tools.function.property maxTokens should not exist"],"error":"Bad Request","statusCode":400} Reproduced 2026-09-10. A report of this arrives with an assistant.model prefix when the payload is nested under an assistant key; a direct POST roots at model. Same validator. Per https://api.vapi.ai/api-json, OpenAIFunction accepts only name, strict, description and parameters, and JsonSchema, used for each property, accepts only type, items, properties, description, pattern, format, required, enum and title. maxTokens is defined on the model schemas alone, with a range of 50 to 10000 and a default of 250, so the token truncation section now points at model.maxTokens and states the real default. The page previously said the default was 100, which is not a value the API has anywhere. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The "Complete tool configuration" template on the custom tools troubleshooting page is not a payload the API accepts. Pasted as a tool it returns 400 twice over, reproduced against POST https://api.vapi.ai/assistant on 2026-09-10: as written model.each value in tools.type must be one of the following values: dtmf, endCall, ... function, mcp, apiRequest, ... with type added, function wrapper still missing model.each value in tools.property name should not exist name, description, parameters and strict belong inside function; type, async and server sit on the tool. The template had them all flat, so it was missing both the discriminator and the wrapper. The corrected template validates: posted with a deliberate unrelated error to force rejection, the tool itself produces no validation failure. server is optional and is included because a custom tool without one has nowhere to send its tool-calls webhook, which is the subject of this page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Lightsage docs evalsWaiting for the staging docs URL before running evals. Lightsage will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes. Commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1209, which touches the same code block. Merge that one first; this diff shrinks to a single block once it lands.
Problem
The "Complete tool configuration" template on the custom tools troubleshooting page is not a payload the API accepts. It has
name,description,parameters,strictandasyncall flat on the tool, with notypeand nofunctionwrapper.Reproduced
POST https://api.vapi.ai/assistant, 2026-09-10, pasting the template as a tool:Add
typeand it fails again on the missing wrapper:The corrected template validates. Posted with a deliberate unrelated error to force rejection, the tool itself produces no validation failure, only the unrelated one.
What changed
One code block, plus a line naming which fields sit where.
name,description,parametersandstrictgo insidefunction.type,asyncandserversit on the tool.serveris optional, confirmed: a correctly nested tool without one returns no error. It is included because a custom tool without a server has nowhere to send its tool-calls webhook, which is what this page is about.Not in this PR
The "Async vs sync behavior" tabs show
asyncinside the function object. That is wrong in the same way, but it does not 400. The API acceptsasyncthere and ignores it, sinceasyncis read at tool level, so it is a silently-inert example rather than a broken one. Left alone here; happy to fix it if wanted.🤖 Generated with Claude Code