-
-
Notifications
You must be signed in to change notification settings - Fork 415
Fixed "Custom field not found" error #121
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
base: dev
Are you sure you want to change the base?
Conversation
|
This fix will produce another error with {
"mcpServers": {
"mcp-server-chart": {
"command": "npx",
"args": [
"-y",
"@antv/mcp-server-chart"
],
"name": "mcp-server-chart"
}
} |
|
Unfortunately, I'm not available for the fix, I'll not be here for a while. Feel free to fix or create a new PR for the issue. |
Actually, the failure to start mcp-server-chart with mcpo and the "Custom field not found" error occur due to a $ref loop in the schema of mcp-server-chart's tool. To resolve this issue, you need to return the tuple (<python_type_hint>, <pydantic_field>)) at the appropriate time in the _process_schema_property() function within mcpo/utils/main.py to break this loop. I'm attempting to draft a commit for this fix. A schema with a $ref causing loop for example: {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/properties/data/properties/children/items"
}
}
},
"required": [
"name"
]
}
}
},
"required": [
"name"
],
"description": "Data for fishbone diagram chart, such as, { name: 'main topic', children: [{ name: 'topic 1', children: [{ name: 'subtopic 1-1' }] }."
},
"theme": {
"type": "string",
"enum": [
"default",
"academy"
],
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'."
},
"width": {
"type": "number",
"default": 600,
"description": "Set the width of chart, default is 600."
},
"height": {
"type": "number",
"default": 400,
"description": "Set the height of chart, default is 400."
}
},
"required": [
"data"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}pr commited: #174 |
Fixes: #117
I added unit tests to make sure it is working.