@@ -90,21 +90,21 @@ impl ServerHandler for RBXStudioServer {
90
90
}
91
91
}
92
92
93
- #[ derive( Debug , serde :: Deserialize , schemars:: JsonSchema ) ]
94
- struct RunCodeArguments {
93
+ #[ derive( Debug , Deserialize , Serialize , schemars:: JsonSchema , Clone ) ]
94
+ struct RunCode {
95
95
#[ schemars( description = "Code to run" ) ]
96
96
command : String ,
97
97
}
98
- #[ derive( Debug , serde :: Deserialize , schemars:: JsonSchema ) ]
99
- struct InsertModelArguments {
98
+ #[ derive( Debug , Deserialize , Serialize , schemars:: JsonSchema , Clone ) ]
99
+ struct InsertModel {
100
100
#[ schemars( description = "Query to search for the model" ) ]
101
101
query : String ,
102
102
}
103
103
104
- #[ derive( Deserialize , Serialize , Clone , Debug ) ]
104
+ #[ derive( Debug , Deserialize , Serialize , schemars :: JsonSchema , Clone ) ]
105
105
enum ToolArgumentValues {
106
- RunCode { command : String } ,
107
- InsertModel { query : String } ,
106
+ RunCode ( RunCode ) ,
107
+ InsertModel ( InsertModel ) ,
108
108
}
109
109
#[ tool_router]
110
110
impl RBXStudioServer {
@@ -120,22 +120,20 @@ impl RBXStudioServer {
120
120
) ]
121
121
async fn run_code (
122
122
& self ,
123
- Parameters ( command ) : Parameters < RunCodeArguments > ,
123
+ Parameters ( args ) : Parameters < RunCode > ,
124
124
) -> Result < CallToolResult , ErrorData > {
125
- self . generic_tool_run ( ToolArgumentValues :: RunCode {
126
- command : command. command ,
127
- } )
128
- . await
125
+ self . generic_tool_run ( ToolArgumentValues :: RunCode ( args) )
126
+ . await
129
127
}
130
128
131
129
#[ tool(
132
130
description = "Inserts a model from the Roblox marketplace into the workspace. Returns the inserted model name."
133
131
) ]
134
132
async fn insert_model (
135
133
& self ,
136
- Parameters ( query ) : Parameters < InsertModelArguments > ,
134
+ Parameters ( args ) : Parameters < InsertModel > ,
137
135
) -> Result < CallToolResult , ErrorData > {
138
- self . generic_tool_run ( ToolArgumentValues :: InsertModel { query : query . query } )
136
+ self . generic_tool_run ( ToolArgumentValues :: InsertModel ( args ) )
139
137
. await
140
138
}
141
139
0 commit comments