Tools do not work with Copilot CLI
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 204
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
I got some erreors when my client (Copilot CLI) tries to execute tools from the MCP server.
The server is well configured, with sse connection, using Docker. You can see below that Copilot communicates well with it:
But when I do a prompt to Copilot and it tries to execute a tool, I always have an error despite the model choice (the error changes depending on model):
- GPT-5:
Model call failed: {"message":"Invalid 'tools[52].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\\.-]+$'.","code":"invalid_value"} - Sonnet 4:
Model call failed: {"message":"tools.52.custom.name: String should match pattern '^[a-zA-Z0-9_-] 1,128}$'","code":"invalid_request_body"} - Sonnet 4.5:
Model call failed: "400 400 Bad Request\n"
Below the detailed errors from logs:
Sonnet 4
2025-10-01T08:07:42.530Z [ERROR] {
"status": 400,
"headers": {
"content-length": "12",
"content-security-policy": "default-src 'none'; sandbox",
"content-type": "text/plain; charset=utf-8",
"date": "Wed, 01 Oct 2025 08:07:42 GMT",
"strict-transport-security": "max-age=31536000",
"x-content-type-options": "nosniff",
"x-github-backend": "Kubernetes",
"x-github-request-id": "EA56:27BEE:BBEBD:DDFE0:68DCE14D",
"x-request-id": "00000-ee07ab1c-8a11-42df-b8c6-868ce769b709"
},
"request_id": "00000-ee07ab1c-8a11-42df-b8c6-868ce769b709",
"ghRequestId": "EA56:27BEE:BBEBD:DDFE0:68DCE14D",
"name": "CAPIError"
}
GPT-5
2025-10-01T08:29:53.462Z [ERROR] {
"status": 400,
"headers": {
"content-length": "129",
"content-security-policy": "default-src 'none'; sandbox",
"content-type": "text/plain; charset=utf-8",
"date": "Wed, 01 Oct 2025 08:29:53 GMT",
"strict-transport-security": "max-age=31536000",
"x-content-type-options": "nosniff",
"x-github-backend": "Kubernetes",
"x-github-request-id": "E6A4:14B8B3:64AB1:76364:68DCE680",
"x-request-id": "00000-5ddef6ae-093f-4c17-b89d-1463c52fdf67"
},
"request_id": "00000-5ddef6ae-093f-4c17-b89d-1463c52fdf67",
"error": {
"message": "tools.52.custom.name: String should match pattern '^[a-zA-Z0-9_-]{1,128}$'",
"code": "invalid_request_body"
},
"code": "invalid_request_body",
"ghRequestId": "E6A4:14B8B3:64AB1:76364:68DCE680",
"name": "CAPIError"
}
Sonnet 4.5
2025-10-01T08:30:08.768Z [ERROR] {
"status": 400,
"headers": {
"content-length": "179",
"content-security-policy": "default-src 'none'; sandbox",
"content-type": "text/plain; charset=utf-8",
"date": "Wed, 01 Oct 2025 08:30:08 GMT",
"strict-transport-security": "max-age=31536000",
"x-content-type-options": "nosniff",
"x-github-backend": "Kubernetes",
"x-github-request-id": "B696:1D0275:C873E:E8367:68DCE68F",
"x-request-id": "00000-5b7623f2-576e-4867-a5ee-dc9eed2e125b"
},
"request_id": "00000-5b7623f2-576e-4867-a5ee-dc9eed2e125b",
"error": {
"message": "Invalid 'tools[52].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\\.-]+$'.",
"code": "invalid_value"
},
"code": "invalid_value",
"ghRequestId": "B696:1D0275:C873E:E8367:68DCE68F",
"name": "CAPIError"
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with Copilot CLI using the Docker-based SSE server and inspect the tool name reported at index 52. Trace how server tool names are exposed to the client; done means Copilot CLI accepts the available tools across the reported models without a 400 name-validation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100