mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
added mcp tests for media
This commit is contained in:
@@ -50,12 +50,28 @@ export const $schema = <
|
||||
{
|
||||
...mcp.getToolOptions("update"),
|
||||
inputSchema: s.strictObject({
|
||||
full: s.boolean({ default: false }).optional(),
|
||||
value: schema as any,
|
||||
return_config: s.boolean({ default: false }).optional(),
|
||||
secrets: s.boolean({ default: false }).optional(),
|
||||
}),
|
||||
},
|
||||
async (params, ctx: AppToolHandlerCtx) => {
|
||||
return ctx.json(params);
|
||||
const { value, return_config, secrets } = params;
|
||||
const [module_name, ...rest] = node.instancePath;
|
||||
|
||||
await ctx.context.app.mutateConfig(module_name as any).overwrite(rest, value);
|
||||
|
||||
let config: any = undefined;
|
||||
if (return_config) {
|
||||
const configs = ctx.context.app.toJSON(secrets);
|
||||
config = getPath(configs, node.instancePath);
|
||||
}
|
||||
|
||||
return ctx.json({
|
||||
success: true,
|
||||
module: module_name,
|
||||
config,
|
||||
});
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user