@@ -7,6 +7,7 @@ use dsc_lib::{
77 dscresources:: {
88 dscresource:: Invoke ,
99 invoke_result:: {
10+ DeleteResult ,
1011 ExportResult ,
1112 GetResult ,
1213 SetResult ,
@@ -28,6 +29,7 @@ pub enum DscOperation {
2829 Set ,
2930 Test ,
3031 Export ,
32+ Delete ,
3133}
3234
3335#[ derive( Serialize , JsonSchema ) ]
@@ -37,6 +39,7 @@ pub enum ResourceOperationResult {
3739 SetResult ( SetResult ) ,
3840 TestResult ( TestResult ) ,
3941 ExportResult ( ExportResult ) ,
42+ DeleteResult ( DeleteResult ) ,
4043}
4144
4245#[ derive( Serialize , JsonSchema ) ]
@@ -57,9 +60,9 @@ pub struct InvokeDscResourceRequest {
5760#[ tool_router( router = invoke_dsc_resource_router, vis = "pub" ) ]
5861impl McpServer {
5962 #[ tool(
60- description = "Invoke a DSC resource operation (Get, Set, Test, Export) with specified properties in JSON format" ,
63+ description = "Invoke a DSC resource operation (Get, Set, Test, Export, Delete ) with specified properties in JSON format" ,
6164 annotations(
62- title = "Invoke a DSC resource operation (Get, Set, Test, Export) with specified properties in JSON format" ,
65+ title = "Invoke a DSC resource operation (Get, Set, Test, Export, Delete ) with specified properties in JSON format" ,
6366 read_only_hint = false ,
6467 destructive_hint = true ,
6568 idempotent_hint = true ,
@@ -94,6 +97,13 @@ impl McpServer {
9497 } ;
9598 Ok ( ResourceOperationResult :: TestResult ( result) )
9699 } ,
100+ DscOperation :: Delete => {
101+ let result = match resource. delete ( & properties_json, & ExecutionKind :: Actual ) {
102+ Ok ( res) => res,
103+ Err ( e) => return Err ( McpError :: internal_error ( e. to_string ( ) , None ) ) ,
104+ } ;
105+ Ok ( ResourceOperationResult :: DeleteResult ( result) )
106+ } ,
97107 DscOperation :: Export => {
98108 let result = match resource. export ( & properties_json) {
99109 Ok ( res) => res,
0 commit comments