Skip to content

Fix validation error in copilot agent #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ar90n
Copy link

@ar90n ar90n commented May 23, 2025

This PR is motivated to fix #25 by adding workaround codes for Copilot Agent.
This PR contains following modifications.

  • Add a custom Json Schema generator whose name is CopilotAgentCompatibleSchema. This generator handles tuple type to add items field.
  • Override model_json_schema to use CopilotAgentCompatibleSchema as default.

Folowing result is the differences between original JsonSchema and modified JsonSchema. In this result, org.json means original JsonSchema and mod.json means modified JsonSchema.

diff org.json mod.json
157a158
>                         "items": {},
345a347
>                         "items": {},
532a535
>                         "items": {},

We can see that there are only adding "items": {} .
And after this PR applied, we get following. It seems that mcp-server-docker works expectedly.

スクリーンショット 2025-05-24 1 14 14

@ar90n ar90n marked this pull request as ready for review May 23, 2025 16:10
@ckreiling
Copy link
Owner

Hey thank you for your contribution! My plan is to pull this branch down locally and test with Claude Desktop to make sure it doesn't introduce any regressions. I will review this PR in the coming days - thanks for your patience

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.

Validation error with Copilot Agent: "tool parameters array type must have items"
2 participants