PR #240 merged: fix: accept destination_uuid on database create (#217)
Summary
The database tool's create action didn't expose destination_uuid in its
zod input schema, so Coolify rejects database creates on any server with
more than one destination configured:
Server has multiple destinations. Please provide a destination_uuid.
The application tool already handles this correctly by exposing
destination_uuid on its create schema. This PR mirrors that pattern for
database.
What was already fine
CreateDatabaseBaseRequestinsrc/types/coolify.tsalready had an optionaldestination_uuidfield, inherited by all the per-engine create request types (CreatePostgresqlRequest,CreateMysqlRequest, etc.).- The client methods (
createPostgresql,createMysql,createMariadb,createMongodb,createRedis,createKeydb,createClickhouse,createDragonfly) all justJSON.stringifythe full request body, so they already forwarddestination_uuidif present. docs/coolify-openapi.yamldocumentsdestination_uuidon every/databases/{type}create endpoint ("UUID of the destination if the server has multiple destinations") — the spec is accurate here, unlike the staleness noted in #236.
The actual bug
Only the MCP tool schema in src/lib/mcp-server.ts was missing the field,
so zod stripped it out of the tool call before it ever reached the client.
Fix
Added destination_uuid: z.string().optional() (with a description
matching the OpenAPI wording) to the database tool's schema. Since the
handler builds the request body via const { action, type, uuid, delete_volumes, ...dbData } = args and forwards dbData straight to
whichever dbMethods[type] client call is selected, this single schema
change covers all 8 create variants (postgresql, mysql, mariadb, mongodb,
redis, keydb, clickhouse, dragonfly) — no handler changes needed.
Test plan
- Added
database tool handlerdescribe block insrc/__tests__/mcp-server.test.tsfollowing the existingapplication tool handlerpattern: assertsdestination_uuidis forwarded tocreatePostgresqlwhen provided, and omitted when not. -
npm test— 365 passed -
npm run lint— 0 errors (2 pre-existingno-explicit-anywarnings, unrelated to this change) -
npx prettier --check .— clean -
npm run build— clean
Closes #217
🤖 Generated with Claude Code