Skip to content

fix: omit required field in tool schema when function has no parameters#5082

Merged
longcw merged 2 commits intomainfrom
longc/fix/omit-required-when-no-parameters
Mar 12, 2026
Merged

fix: omit required field in tool schema when function has no parameters#5082
longcw merged 2 commits intomainfrom
longc/fix/omit-required-when-no-parameters

Conversation

@longcw
Copy link
Contributor

@longcw longcw commented Mar 11, 2026

close #5051

groq returns an error "invalid JSON schema for tool tool_without_parameters, tools[1].function.parameters: \'required\' present but \'properties\' is missing" when the function tool defined without a parameter.

#4613 didn't fix the issue since it's actually raised when properties is empty but required presents. it's fixed by avoiding empty required.

@chenghao-mou chenghao-mou requested a review from a team March 11, 2026 09:24
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@longcw longcw changed the title fix: omit 'required' field in tool schema when function has no parameters fix: omit required field in tool schema when function has no parameters Mar 11, 2026
@longcw longcw merged commit 016da5e into main Mar 12, 2026
18 checks passed
@longcw longcw deleted the longc/fix/omit-required-when-no-parameters branch March 12, 2026 02:13
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.

2 participants