Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
I’m creating an MCP server and testing it with Cursor. I’m using Spring AI to provide the plumbing. Cursor connects to the MCP Server and enumerates the tools, and seems to understand them. It can do a complex process like gather all the information for creating a new “organization”, including using reference APIs to look up things like states, timezones, etc. However, after all of that, the message it generates for the tool call is garbled.
Steps to Reproduce
My use case is Spring AI with a complex object definition as a parameter. As far as I can tell, the json schema is correct. Cursor can call simple tool methods and generally do all the steps necessary to gather data for the final tool call. However, the resulting data is garbled.
Expected Behavior
The MCP client should make tool calls with a valid payload.
Operating System
Linux
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.6.45
VSCode Version: 1.99.3
Commit: 3ccce8f55d8cca49f6d28b491a844c699b8719a0
Date: 2025-09-22T18:22:38.013Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.14.0-29-generic
For AI issues: which model did you use?
I don’t know, I can’t see that info and Cursor couldn’t tell me.
Additional Information
This is an example of the garbled output it generates:
“billingContact”: “{‘id’: ‘11ed4270-9138d0-b13b188d93620firstName’: ‘Joe’, ‘lastName’: ‘Test’, ‘jobTitle’: ‘MCP Tester’, ‘workEmail’: ‘[email protected]’, ‘workPhone’: {‘number’: ‘7705551212’}, ‘contactType’: ‘CONTACT’}”,
The id value is mashed up with the firstName name.
And another:
“billingAddress”: “{}‘street1’: ‘123 test street’, ‘city’: ‘atlanta’, ‘state’: {‘id’: '11ed4270-922-5aae-b13a-12b18893619, ‘name’: ‘Georgia’, ‘shortName’: ‘GA’}, ‘country’: {‘id’: '11ed4270-913f-8b13a-12188d93619 ‘name’: ‘United States of America’, ‘shortName’: ‘US’}, ‘postalCode’: 11223, ‘timezone’: {‘zoneId’: ‘America/New_York’, ‘label’: ‘Eastern Standard Time’, ‘offsetAsSeconds’: -300}}”,
Inclusion of random {} at the beginning there.
Does this stop you from using Cursor
No - Cursor works, but with this issue
The tool schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"Address": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name"
},
"country": {
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the country (ShortUUID format)"
},
"name": {
"type": "string",
"description": "Full name of the country"
},
"shortName": {
"type": "string",
"description": "Short code for the country (ISO 3166-1 alpha-2)"
}
},
"description": "Represents a country with its identifier, full name, and short code.\nUsed for address information and localization purposes.\n"
},
{
"description": "Country information"
}
]
},
"displayAddress": {
"type": "string",
"description": "Formatted display address string"
},
"gpsLocation": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
},
"required": [
"latitude",
"longitude"
],
"description": "GPS coordinates for the address"
},
"id": {
"type": "string",
"description": "Unique identifier for the address (ShortUUID format)"
},
"metro": {
"type": "string",
"description": "Metropolitan area designation"
},
"postalCode": {
"type": "string",
"description": "Postal/ZIP code"
},
"postalCodePlus4": {
"type": "string",
"description": "Extended postal code (ZIP+4 format)"
},
"state": {
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the state/province (ShortUUID format)"
},
"name": {
"type": "string",
"description": "Full name of the state or province"
},
"shortName": {
"type": "string",
"description": "Short code for the state or province"
}
},
"description": "Represents a state or province with its identifier, full name, and short code.\nUsed for address information and localization purposes.\n"
},
{
"description": "State or province information"
}
]
},
"street1": {
"type": "string",
"description": "Primary street address line"
},
"street2": {
"type": "string",
"description": "Secondary street address line (apartment, suite, etc.)"
},
"timezone": {
"allOf": [
{
"type": "object",
"properties": {
"label": {
"type": "string",
"description": "Human-readable timezone label"
},
"offsetAsSeconds": {
"type": "integer",
"format": "int32",
"description": "Timezone offset in seconds from UTC"
},
"zoneId": {
"type": "string",
"description": "Timezone zone ID (e.g., 'America/Los_Angeles')"
}
},
"description": "Represents timezone information for UI display purposes.\nContains timezone details including offset and display information.\n"
},
{
"description": "Timezone information for the address"
}
]
}
},
"description": "Represents a physical address with optional GPS coordinates and timezone information.\nUsed for both billing and mailing addresses of organizations.\n"
},
"Contact": {
"type": "object",
"properties": {
"address": {
"$ref": "#/$defs/Address",
"description": "Contact's physical address"
},
"allowSmsMobilePhone": {
"type": "boolean",
"description": "Whether SMS is allowed on the mobile phone"
},
"contactType": {
"allOf": [
{
"type": "string",
"enum": [
"CONTACT",
"UNKNOWN",
"USER"
],
"description": "Type of contact in the system"
},
{
"description": "Type of contact (CONTACT, USER, UNKNOWN)"
}
]
},
"firstName": {
"type": "string",
"description": "Contact's first name"
},
"homeEmail": {
"type": "string",
"description": "Contact's personal/home email address"
},
"id": {
"type": "string",
"description": "Unique identifier for the contact (ShortUUID format)"
},
"jobTitle": {
"type": "string",
"description": "Contact's job title or position"
},
"lastName": {
"type": "string",
"description": "Contact's last name"
},
"locale": {
"type": "object",
"description": "Contact's preferred locale setting"
},
"mobilePhone": {
"type": "object",
"properties": {
"allowSMS": {
"type": "boolean"
},
"number": {
"type": "string"
}
},
"required": [
"allowSMS",
"number"
],
"description": "Contact's mobile phone number"
},
"otherEmail": {
"type": "string",
"description": "Contact's alternative email address"
},
"otherPhone": {
"$ref": "#/$defs/Phone",
"description": "Contact's alternative phone number"
},
"workEmail": {
"type": "string",
"description": "Contact's primary work email address"
},
"workPhone": {
"$ref": "#/$defs/Phone",
"description": "Contact's work phone number"
}
},
"required": [
"workEmail"
],
"description": "Represents contact information for a person, including personal details,\ncommunication methods, and preferences. Used for both billing and mailing contacts.\n"
},
"LocalTimeWindow": {
"type": "object",
"properties": {
"end": {
"type": "string",
"format": "time"
},
"start": {
"type": "string",
"format": "time"
}
},
"required": [
"end",
"start"
]
},
"Phone": {
"type": "object",
"properties": {
"number": {
"type": "string"
}
},
"required": [
"number"
]
}
},
"type": "object",
"properties": {
"billingAddress": {
"$ref": "#/$defs/Address",
"description": "Billing address for the organization"
},
"billingContact": {
"$ref": "#/$defs/Contact",
"description": "Billing contact information for the organization"
},
"hoursOfOperation": {
"type": "object",
"properties": {
"friday": {
"type": "array",
"items": {
"$ref": "#/$defs/LocalTimeWindow"
}
},
"monday": {
"type": "array",
"items": {
"$ref": "#/$defs/LocalTimeWindow"
}
},
"saturday": {
"type": "array",
"items": {
"$ref": "#/$defs/LocalTimeWindow"
}
},
"sunday": {
"type": "array",
"items": {
"$ref": "#/$defs/LocalTimeWindow"
}
},
"thursday": {
"type": "array",
"items": {
"$ref": "#/$defs/LocalTimeWindow"
}
},
"tuesday": {
"type": "array",
"items": {
"$ref": "#/$defs/LocalTimeWindow"
}
},
"wednesday": {
"type": "array",
"items": {
"$ref": "#/$defs/LocalTimeWindow"
}
},
"zoneId": {
"type": "string"
}
},
"required": [
"friday",
"monday",
"saturday",
"sunday",
"thursday",
"tuesday",
"wednesday",
"zoneId"
],
"description": "Hours of operation for the organization"
},
"labels": {
"description": "Optional labels/tags to associate with the organization",
"type": "array",
"items": {
"type": "string"
}
},
"mailingAddress": {
"$ref": "#/$defs/Address",
"description": "Mailing address for the organization (may differ from billing address)"
},
"mailingContact": {
"$ref": "#/$defs/Contact",
"description": "Mailing contact information for the organization"
},
"name": {
"type": "string",
"description": "Name of the organization"
},
"organizationType": {
"allOf": [
{
"type": "string",
"enum": [
"GROUP",
"ROOFTOP",
"UNKNOWN"
],
"description": "Type of organization in the system"
},
{
"description": "Type of organization being created"
}
]
},
"parentId": {
"type": "string",
"description": "ID of the parent organization (for ROOFTOP organizations under a GROUP)"
},
"websiteUrl": {
"type": "string",
"description": "Organization's website URL",
"pattern": "https?://.*"
}
},
"required": [
"billingAddress",
"billingContact",
"mailingAddress",
"mailingContact",
"name",
"organizationType"
],
"description": "Request to create a new organization in the system. Organizations can be either GROUPs (parent companies)\nor ROOFTOPs (individual dealerships/locations). Requires billing and mailing address/contact information.\n",
"additionalProperties": false
}
The full generated tool call:
"name": "MCP Created Organization",
"organizationType": "ROOFTOP",
"billingAddress": "{}'street1': '123 test street', 'city': 'atlanta', 'state': {'id': '11ed4270-922-5aae-b13a-12b18893619, 'name': 'Georgia', 'shortName': 'GA'}, 'country': {'id': '11ed4270-913f-8b13a-12188d93619 'name': 'United States of America', 'shortName': 'US'}, 'postalCode': 11223, 'timezone': {'zoneId': 'America/New_York', 'label': 'Eastern Standard Time', 'offsetAsSeconds': -300}}",
"billingContact": "{'firstName': 'Joe', 'lastName': 'test', 'workEmail': '[email protected]', 'workPhone': {'number': '7705551212'}, 'contactType': 'CONTACT'}",
"mailingAddress": "{}'street1': '123 test street', 'city': 'atlanta', 'state': {'id': '11ed4270-922-5aae-b13a-12b18893619, 'name': 'Georgia', 'shortName': 'GA'}, 'country': {'id': '11ed4270-913f-8b13a-12188d93619 'name': 'United States of America', 'shortName': 'US'}, 'postalCode': 11223, 'timezone': {'zoneId': 'America/New_York', 'label': 'Eastern Standard Time', 'offsetAsSeconds': -300}}",
"mailingContact": "{'firstName': 'Joe', 'lastName': 'test', 'workEmail': '[email protected]', 'workPhone': {'number': '7705551212'}, 'contactType': 'CONTACT'}",
"hoursOfOperation": {
"monday": [
{
"start": "09:00",
"end": "17:00"
}
],
"tuesday": [
{
"start": "09:00",
"end": "17:00"
}
],
"wednesday": [
{
"start": "09:00",
"end": "17:00"
}
],
"thursday": [
{
"start": "09:00",
"end": "17:00"
}
],
"friday": [
{
"start": "09:00",
"end": "17:00"
}
],
"saturday": [],
"sunday": [],
"zoneId": "America/New_York"
}
}