Skip to content

docs: make the complete tool configuration template a valid payload - #1210

Open
chiranjeet-vapi wants to merge 2 commits into
VapiAI:mainfrom
chiranjeet-vapi:docs/fix-complete-tool-config-template
Open

docs: make the complete tool configuration template a valid payload#1210
chiranjeet-vapi wants to merge 2 commits into
VapiAI:mainfrom
chiranjeet-vapi:docs/fix-complete-tool-config-template

Conversation

@chiranjeet-vapi

Copy link
Copy Markdown
Contributor

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, strict and async all flat on the tool, with no type and no function wrapper.

Reproduced

POST https://api.vapi.ai/assistant, 2026-09-10, pasting the template as a tool:

model.each value in tools.type must be one of the following values: dtmf, endCall,
transferCall, ... function, mcp, apiRequest, ...

Add type and it fails again on the missing wrapper:

model.each value in tools.property name should not exist

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, parameters and strict go inside function. type, async and server sit on the tool.

server is 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 async inside the function object. That is wrong in the same way, but it does not 400. The API accepts async there and ignores it, since async is 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

chiranjeet-vapi and others added 2 commits September 10, 2026 03:08
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-app

lightsage-app Bot commented Sep 10, 2026

Copy link
Copy Markdown

Lightsage docs evals

Waiting 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: 27b043f
Status: waiting for staging docs URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant