generator icon indicating copy to clipboard operation
generator copied to clipboard

MCP Tool Validation Error: "tool parameters array type must have items"

Open Mistralys opened this issue 9 months ago • 1 comments

Description

When using the PHP CTX generator as an MCP server with GitHub Copilot in VS Code, the extension sees all tools provided by CTX, but starting a conversation fails with the error message:

Failed to validate tool mcp_project_size_file-read: Error: tool parameters array type must have items

How To Reproduce

  1. Set up context.yaml (see below)
  2. Run ctx generate
  3. Start VS Code (Windows)
  4. Configure CTX MCP in Copilot (see below)
  5. Start MCP server via VS Code > Sees 25 tools
  6. Start a chat conversation
  7. Error message is shown

context.yaml

$schema: 'https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json'

documents:
  -
    description: 'Project - Overview'
    outputPath: README.md
    overwrite: true
    sources:
      - type: file
        description: "Overview"
        sourcePaths:
          - README.md
        filePattern: "README.md"

MCP Server config

{
	"servers": {
		"Project CTX": {
			"type": "stdio",
			"command": "ctx",
			"args": [
				"server",
				"-c",
				"F:\\Path\\To\\Project"
			]
		}
	},
	"inputs": []
}

Additional Info

Q A
Library Version 1.33.0
PHP Version 8.4
Operating System Windows 11
IDE Visual Studio Code
Chat Extension GitHub Copilot

Copilot Chat Log with error message

2026-02-16 19:37:46.882 [error] Error: tool parameters array type must have items
	at c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1602:74
	at Z5 (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1602:1687)
	at Z5 (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1602:2303)
	at Z5 (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1602:2303)
	at c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1602:14
	at kR (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1601:8389)
	at Che.fetch (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:2001:8221)
	at Che.runOne (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1648:7707)
	at async Che.run (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:1648:2288)
	at async jy.runWithToolCalling (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:2001:11)
	at async jy.getResult (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:2000:1437)
	at async She.getResult (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:2005:5959)
	at async RM.getResult (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:2018:9182)
	at async t3.x (c:\Users\user\.vscode\extensions\github.copilot-chat-0.37.6\dist\extension.js:6200:1359)
	at async _d.$invokeAgent (file:///c:/Users/user/AppData/Local/Programs/Microsoft%20VS%20Code/c3a26841a8/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:144:53500)
2026-02-16 19:38:07.469 [info] message 0 returned. finish reason: [stop]

Mistralys avatar Feb 16 '26 19:02 Mistralys

A Gemini debugging session found the following:

"The MCP server is returning a JSON Schema for the file-read tool (and potentially others) that defines a parameter as {"type": "array"} but omits the required items field."

So this is potentially a bug with a missing parameter definition, which Copilot's zealous validation is catching.

Mistralys avatar Feb 16 '26 19:02 Mistralys