@@ -149,20 +149,20 @@ public struct MCPServerMacro: MemberMacro, ExtensionMacro {
149149 /// - arguments: A dictionary of arguments to pass to the tool
150150 /// - Returns: The result of the tool call
151151 /// - Throws: MCPToolError if the tool doesn't exist or cannot be called
152- func callTool(_ name: String, arguments: [String: Any]) throws -> Codable {
153- // Find the tool by name
154- guard let tool = mcpTools.first(where: { $0.name == name }) else {
155- throw MCPToolError.unknownTool(name: name)
156- }
152+ public func callTool(_ name: String, arguments: [String: Any]) throws -> Codable {
153+ // Find the tool by name
154+ guard let tool = mcpTools.first(where: { $0.name == name }) else {
155+ throw MCPToolError.unknownTool(name: name)
156+ }
157157
158- // Enrich arguments with default values
159- let enrichedArguments = try tool.enrichArguments(arguments, forObject: self)
158+ // Enrich arguments with default values
159+ let enrichedArguments = try tool.enrichArguments(arguments, forObject: self)
160160
161- // Call the appropriate wrapper method based on the tool name
162- switch name {
163- \( switchCases. joined ( separator: " \n " ) )
164- default: throw MCPToolError.unknownTool(name: name)
165- }
161+ // Call the appropriate wrapper method based on the tool name
162+ switch name {
163+ \( switchCases. joined ( separator: " \n " ) )
164+ default: throw MCPToolError.unknownTool(name: name)
165+ }
166166 }
167167 """
168168
0 commit comments