Skip to content

Commit 283ec9c

Browse files
authored
fix: filter MCP-specific fields from database creation requests (#59)
The database tool was passing all parameters including 'action', 'type', 'uuid', and 'delete_volumes' to the Coolify API, causing validation errors. The API only expects database-specific fields. This fix extracts MCP-specific fields and only passes the relevant database configuration to the API. Fixes #58
1 parent ed5e2d2 commit 283ec9c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib/mcp-server.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,10 @@ export class CoolifyMcpServer extends McpServer {
403403
dragonfly_password: z.string().optional(),
404404
},
405405
async (args) => {
406-
const { action, type, uuid } = args;
406+
const { action, type, uuid, delete_volumes, ...dbData } = args;
407407
if (action === 'delete') {
408408
if (!uuid) return { content: [{ type: 'text' as const, text: 'Error: uuid required' }] };
409-
return wrap(() =>
410-
this.client.deleteDatabase(uuid, { deleteVolumes: args.delete_volumes }),
411-
);
409+
return wrap(() => this.client.deleteDatabase(uuid, { deleteVolumes: delete_volumes }));
412410
}
413411
// create
414412
if (!type || !args.server_uuid || !args.project_uuid) {
@@ -428,7 +426,7 @@ export class CoolifyMcpServer extends McpServer {
428426
clickhouse: (d) => this.client.createClickhouse(d),
429427
dragonfly: (d) => this.client.createDragonfly(d),
430428
};
431-
return wrap(() => dbMethods[type](args));
429+
return wrap(() => dbMethods[type](dbData));
432430
},
433431
);
434432

0 commit comments

Comments
 (0)