Describe the Bug
When using plugin-mcp with a collection that contains a point field (geolocation), enabling MCP create/update for that collection causes MCP tool schema generation/translation to fail for OpenAI-compatible tool calling.
In VS Code Copilot Chat (MCP integration), the request fails with a 400 error because the function parameter schema is an array/tuple instead of an object:
Request Failed: 400 {"error":{"message":"Invalid schema for function '...createCities': [{'type': 'number'}, {'type': 'number'}] is not of type 'object', 'boolean'.","code":"invalid_request_body"}}
This matches how Payload represents point values in data: e.g. coordinates: [41.0082, 28.9784] (a 2-number tuple). find tools work, but any generated createX / updateX tool that includes a point field causes schema incompatibility with OpenAI tool parameters requirements (must be a JSON Schema object).
Link to the code that reproduces this issue
https://github.com/findmydoc-platform/website/blob/7498b148e0650e4b32d1dcc683667a0bbaa5f78d/src/collections/Cities.ts#L42
Reproduction Steps
- Create a new Payload v3 project:
pnpx create-payload-app@latest -t blank
- Configure Postgres (any local Postgres is fine) and set
DATABASE_URI.
- Install and enable MCP plugin:
pnpm add @payloadcms/plugin-mcp
- Add a collection (e.g.
cities) containing a point. field:
- Example field:
coordinates with type: 'point' and required: true.
- Configure the mcp plugin to expose the collection as writable (create/update enabled). (Exact config may vary, but the key is: the tool for
createCities / updateCities gets generated.)
- Start the server (Next.js node runtime):
- Connect via an MCP client that routes tool definitions through OpenAI function calling schema validation (e.g., VS Code Copilot Chat MCP).
- Observe failure during tool registration / invocation with an error like:
Invalid schema for function 'createCities': [{'type':'number'}, {'type':'number'}] is not of type 'object', 'boolean'.
Expected:
- Tools should register successfully and
createCities / updateCities should accept a valid schema for a point field. (either as { latitude: number, longitude: number } or an array nested under an object property) without violating OpenAI tool parameter requirements.
Observed:
- Tool schema is rejected because the generated/translated parameters schema is an array/tuple rather than an object.
Which area(s) are affected?
plugin: mcp
Environment Info
Binaries:
Node: 25.3.0
npm: 11.7.0
Yarn: N/A
pnpm: 10.12.3
Relevant Packages:
payload: 3.70.0
next: 15.5.9
@payloadcms/db-postgres: 3.70.0
@payloadcms/drizzle: 3.70.0
@payloadcms/email-nodemailer: 3.70.0
@payloadcms/graphql: 3.70.0
@payloadcms/live-preview: 3.70.0
@payloadcms/live-preview-react: 3.70.0
@payloadcms/next/utilities: 3.70.0
@payloadcms/payload-cloud: 3.70.0
@payloadcms/plugin-cloud-storage: 3.70.0
@payloadcms/plugin-form-builder: 3.70.0
@payloadcms/plugin-import-export: 3.70.0
@payloadcms/plugin-mcp: 3.70.0
@payloadcms/plugin-nested-docs: 3.70.0
@payloadcms/plugin-redirects: 3.70.0
@payloadcms/plugin-search: 3.70.0
@payloadcms/plugin-seo: 3.70.0
@payloadcms/richtext-lexical: 3.70.0
@payloadcms/storage-s3: 3.70.0
@payloadcms/translations: 3.70.0
@payloadcms/ui/shared: 3.70.0
react: 19.2.3
react-dom: 19.2.3
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.2.0 (macOS)
Available memory (MB): 24576
Available CPU cores: 14
Describe the Bug
When using plugin-mcp with a collection that contains a point field (geolocation), enabling MCP create/update for that collection causes MCP tool schema generation/translation to fail for OpenAI-compatible tool calling.
In VS Code Copilot Chat (MCP integration), the request fails with a 400 error because the function parameter schema is an array/tuple instead of an object:
Request Failed: 400 {"error":{"message":"Invalid schema for function '...createCities': [{'type': 'number'}, {'type': 'number'}] is not of type 'object', 'boolean'.","code":"invalid_request_body"}}This matches how Payload represents point values in data: e.g. coordinates:
[41.0082, 28.9784](a 2-number tuple). find tools work, but any generated createX / updateX tool that includes a point field causes schema incompatibility with OpenAI tool parameters requirements (must be a JSON Schema object).Link to the code that reproduces this issue
https://github.com/findmydoc-platform/website/blob/7498b148e0650e4b32d1dcc683667a0bbaa5f78d/src/collections/Cities.ts#L42
Reproduction Steps
pnpx create-payload-app@latest -t blankDATABASE_URI.pnpm add @payloadcms/plugin-mcpcities) containing a point. field:coordinateswithtype: 'point'andrequired: true.createCities/updateCitiesgets generated.)pnpm devInvalid schema for function 'createCities': [{'type':'number'}, {'type':'number'}] is not of type 'object', 'boolean'.Expected:
createCities/updateCitiesshould accept a valid schema for a point field. (either as{ latitude: number, longitude: number }or an array nested under an object property) without violating OpenAI tool parameter requirements.Observed:
Which area(s) are affected?
plugin: mcp
Environment Info