Skip to content

Tool registration error: contentType enum is empty for mcp_mcp-server-dr_content_search_content #8

@robertoperuzzo

Description

@robertoperuzzo

Environment

  • MCP server image: ghcr.io/omedia/mcp-server-drupal:latest
  • Started via docker in mcp.json (see below)
  • VSCode LocalProcess extension (discovered 74 tools)
  • macOS

Reproduction steps

  1. Start the MCP Drupal server using the mcp.json below.
  2. Open Copilot (GPT-5 mini) or trigger tool discovery.
  3. Observe validation error in the extension output.

Observed

Failed to validate tool mcp_mcp-server-dr_content_search_content: Error: tool parameters do not match JSON schema: /properties/contentType/enum must NOT have fewer than 1 items. Please open a Github issue for the MCP server or extension which provides this tool

Relevant server logs

2025-10-02 18:49:24.016 [info] Starting server mcp-server-drupal
2025-10-02 18:49:24.016 [info] Connection state: Starting
2025-10-02 18:49:24.022 [info] Starting server from LocalProcess extension host
2025-10-02 18:49:24.023 [info] Connection state: Starting
2025-10-02 18:49:24.023 [info] Connection state: Running
2025-10-02 18:49:24.180 [warning] [server stderr] DANGER: TLS certificate validation is disabled for all hostnames
2025-10-02 18:49:29.026 [info] Waiting for server to respond to `initialize` request...
2025-10-02 18:49:57.016 [warning] [server stderr] 
2025-10-02 18:49:57.016 [warning] [server stderr] INFO: Drupal MCP server is running on STDIO
2025-10-02 18:49:57.024 [warning] [server stderr] INFO: Initialization was successful
2025-10-02 18:49:57.024 [info] Discovered 74 tools

mcp.json used to start the server

{
    "servers": {
        "context7": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@upstash/context7-mcp"
            ]
        },
        "mcp-server-drupal": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "DRUPAL_AUTH_USER",
                "-e",
                "DRUPAL_AUTH_PASSWORD",
                "--network=host",
                "ghcr.io/omedia/mcp-server-drupal:latest",
                "--drupal-url=https://mcp.ddev.site:33001",
                "--unsafe-net"
            ],
            "env": {
                "DRUPAL_AUTH_USER": "mcp_user",
                "DRUPAL_AUTH_PASSWORD": "mcp_user"
            }
        }
    },
    "globalShortcut": ""
}

Expected

The server should publish valid tool schemas. If there are no content types to enumerate, the tool descriptor must not emit an empty enum for contentType (JSON Schema requires enum arrays to have >= 1 item).

Suggested fix (for server/extension maintainers)

  • Do not emit an empty enum. Options:
    • Remove the enum when there are no values.
    • Provide at least one allowed value in the enum.
    • Make contentType optional / provide a sensible default.

Example safe alternatives:

// remove enum
"contentType": { "type": "string" }

or

// provide values
"contentType": { "type": "string", "enum": ["article", "page"] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions