Skip to content

Cannot pass array inputs correctly (type: array results in string) #281

Closed
@nikhil-pandey

Description

@nikhil-pandey

Description:
When using a tool input schema with a field of type: array (e.g., ["string"]), the inspector renders the input as a text field, and the value is passed as a single string rather than a proper JSON array. This causes schema validation to fail on the receiving server.

To Reproduce:

  1. Define a tool with an inputSchema that includes an array of strings (e.g., type: ["array", "null"], items: { "type": "string" })
  2. Attempt to invoke the tool from the inspector
  3. Observe the input is passed as a string instead of a list (e.g., "["a", "b"]" instead of ["a", "b"])
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "tags": {
      "type": ["array", "null"],
      "items": {
        "type": "string"
      },
      "description": "Optional list of tags."
    }
  },
  "required": []
}

Expected behavior:
Inspector should recognize array types and provide UI to input a list, or at least pass a properly structured array to the backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions