Skip to content

fix(schema): invalid regex in databasePassword patterns breaks DeepSeek API #43

Closed

Description

@BlazzzPlay

Bug

The databasePassword (and databaseRootPassword, password) fields across libsql-create, mariadb-create, mongo-create, mysql-create, postgres-create, and their password-change counterparts use a Zod .regex() pattern that produces an invalid JSON Schema regex. DeepSeek API's schema validator rejects it with:

Error from provider (DeepSeek): Invalid schema for function 'dokploy_libsql-create': "^[a-zA-Z0-9@#%^&*()_+\\-=[\\]{}|;:,.<>?~`]*$" is not a "regex"

Steps to Reproduce

  1. Configure @dokploy/mcp with DeepSeek as the LLM provider
  2. The MCP server sends tools/list to DeepSeek
  3. DeepSeek rejects the schema because the pattern regex is not valid ECMA-262

Root Cause

The regex ^[a-zA-Z0-9@#%^&*()_+=[\]{}|;:,.<>?~-]*$(or its zod-to-json-schema-transformed variant) contains characters that DeepSeek's JSON Schema validator does not accept as a valid regex. Likely the backtick or how zod-to-json-schema escapes the-` inside the character class.

Affected Tools

All tools with databasePassword, databaseRootPassword, or password fields using this regex:

  • libsql-create, libsql-update
  • mariadb-create, mariadb-update, mariadb-changePassword
  • mongo-create, mongo-update, mongo-changePassword
  • mysql-create, mysql-update, mysql-changePassword
  • postgres-create, postgres-update, postgres-changePassword
  • redis-changePassword

Expected Behavior

All database-related tools should register successfully with any provider that validates JSON Schema patterns (DeepSeek, Anthropic, OpenAI, etc.).

Suggested Fix

Replace the .regex() constraint with a simpler validation or remove it entirely — the server validates the password anyway. For example, use z.string().min(1) instead of z.string().regex(...).

Operating System

Linux

Agent / Client

OpenCode (OpenCode CLI)

Shell

bash

Activity

  1. added a commit that references this issue on Aug 7, 2026
    5e9c9df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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