Skip to content
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

Bug: Error when processing JSON schema with array items having multiple value types #16

Open
twinity1 opened this issue Mar 6, 2025 · 0 comments

Comments

@twinity1
Copy link

twinity1 commented Mar 6, 2025

Description

When using a schema that includes an array of custom fields with multiple possible value types, the tool fails with an "unhashable type: 'list'" error.

Error Message

Error gathering tools: unhashable type: 'list'
Traceback (most recent call last):
  ...
  File "/Users/ales/.local/share/uv/tools/mcp-client-cli/lib/python3.13/site-packages/jsonschema_pydantic/transform.py", line 60, in convert_type
    return type_mapping.get(type_, Any)
  TypeError: unhashable type: 'list'

Reproduction Steps

  1. Define a schema with a customFields array that has items with multiple possible value types
  2. The schema includes a structure like:
{
  "name": "update-issue",
  "description": "Update fields of an existing Redmine issue",
  "inputSchema": {
    "type": "object",
    "properties": {
      ... other fields ...
      "customFields": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Custom field ID"
            },
            "value": {
              "type": ["string", "number", "boolean"], // multiple types
              "description": "Custom field value"
            }
          },
          "required": ["id", "value"],
          "additionalProperties": false
        },
        "description": "Custom fields array [{id: number, value: any}]"
      }
    },
    "additionalProperties": false,
    "$schema": "http://json-schema.org/draft-07/schema#"
  }
}

Thank you for developing this tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant