Skip to content

fix(codecompanion): add additionalProperties to tool_input of use_mcp#264

Merged
ravitemer merged 1 commit into
ravitemer:mainfrom
misumisumi:fix/invalid-shama
Jan 15, 2026
Merged

fix(codecompanion): add additionalProperties to tool_input of use_mcp#264
ravitemer merged 1 commit into
ravitemer:mainfrom
misumisumi:fix/invalid-shama

Conversation

@misumisumi
Copy link
Copy Markdown
Contributor

Description

Following error cause using GPT-5.x of github copilot on codecompanion.

[ERROR] 2026-01-15 19:50:48
Error: {"error":{"message":"Invalid schema for function 'use_mcp_tool': In context=('properties', 'tool_input', 'type', '0'), 'additionalProperties' is required to be supplied and to be false.","code":"invalid_request_body"}}
[ERROR] 2026-01-15 19:50:48
[chat::_submit_http] Error: {
  body = "{\"error\":{\"message\":\"Invalid schema for function 'use_mcp_tool': In context=('properties', 'tool_input', 'type', '0'), 'additionalProperties' is required to be supplied and to be false.\",\"code\":\"invalid_request_body\"}}",
  exit = 0,
  headers = { "content-security-policy: default-src 'none'; sandbox", "content-type: text/plain; charset=utf-8", "strict-transport-security: max-age=31536000", "x-content-type-options: nosniff", "x-request-id: 00000-e149250b-593b-4265-a5d7-c0adc069495a", "date: Thu, 15 Jan 2026 10:50:48 GMT", "content-length: 219", "x-github-backend: Kubernetes", "x-github-request-id: F3C9:2D4625:2114F0:256D7F:6968C687" },
  status = 400
}

The error occurs because tool_input is an object. olimorris/codecompanion.nvim#2334 supports strict mode for nested objects, and it works correctly by simply adding additionalProperties.

Related Issue(s)

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated the README and/or relevant docs pages
  • I've run make test to ensure all tests pass
  • I've run make format to format the code
  • I've run make docs to update the vimdoc pages

@ravitemer ravitemer merged commit 9c38dd4 into ravitemer:main Jan 15, 2026
5 checks passed
@ravitemer
Copy link
Copy Markdown
Owner

Thanks for fixing this!

lattenwald pushed a commit to lattenwald/mcphub.nvim that referenced this pull request Jan 18, 2026
…_tool (ravitemer#264)

Co-authored-by: misumisumi <s.kobayashi@misumi-sumi.com>
lattenwald added a commit to lattenwald/mcphub.nvim that referenced this pull request Jan 18, 2026
…cXKcu

fix(codecompanion): add additionalProperties to tool_input of use_mcp_tool (ravitemer#264)
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.

[Bug]: Copilot w/ GPT-5 series models fails with "Invalid schema" for several tools

2 participants