Skip to content

Commit 712936a

Browse files
feat(deStyle): add remove_style action to enhance style management capabilities
- Updated the deStyle tool to include a new `remove_style` action, allowing users to remove specific styles by name and optionally specify parent styles. - Enhanced the tool's description to reflect the new functionality. - Updated validation to ensure at least one of the style-related actions (create_style, get_styles, update_style, remove_style, query_styles) is provided.
1 parent 501940b commit 712936a

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/tools/deStyle.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function registerDEStyleTools(server: McpServer, rpc: RPCType) {
2121
openWorldHint: true,
2222
},
2323
description:
24-
"Designer Tool - Style tool to perform actions like create style, get all styles, update styles",
24+
"Designer Tool - Style tool to perform actions like create style, get all styles, update styles, remove styles",
2525
inputSchema: {
2626
...SiteIdSchema,
2727
actions: z.array(
@@ -149,6 +149,16 @@ export function registerDEStyleTools(server: McpServer, rpc: RPCType) {
149149
})
150150
.optional()
151151
.describe("Update a style"),
152+
remove_style: z
153+
.object({
154+
style_name: z.string().describe("The name of the style to remove"),
155+
parent_style_names: z
156+
.array(z.string())
157+
.optional()
158+
.describe("The parent style names (for combo class)"),
159+
})
160+
.optional()
161+
.describe("Remove a style"),
152162
query_styles: z
153163
.object({
154164
queries: z.array(
@@ -174,11 +184,11 @@ export function registerDEStyleTools(server: McpServer, rpc: RPCType) {
174184
.strict()
175185
.refine(
176186
(d) =>
177-
[d.create_style, d.get_styles, d.update_style, d.query_styles].filter(Boolean)
187+
[d.create_style, d.get_styles, d.update_style, d.remove_style, d.query_styles].filter(Boolean)
178188
.length >= 1,
179189
{
180190
message:
181-
"Provide at least one of create_style, get_styles, update_style, query_styles.",
191+
"Provide at least one of create_style, get_styles, update_style, remove_style, query_styles.",
182192
},
183193
),
184194
),

0 commit comments

Comments
 (0)