File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public fun <T : Any> Server.registerToolFromAnnotatedFunction(
6464 val properties = buildJsonObject {
6565 function.valueParameters.forEach { param ->
6666 val paramAnnotation = param.findAnnotation<McpParam >()
67- val paramName = param.name ? : " param${param.index } "
67+ val paramName = param.name ? : " param${function.valueParameters.indexOf(param) } "
6868
6969 putJsonObject(paramName) {
7070 val type = when {
@@ -91,7 +91,7 @@ public fun <T : Any> Server.registerToolFromAnnotatedFunction(
9191 val paramAnnotation = param.findAnnotation<McpParam >()
9292 paramAnnotation?.required != false && ! param.isOptional
9393 }
94- .map { it.name ? : " param${it.index } " }
94+ .map { it.name ? : " param${function.valueParameters.indexOf(it) } " }
9595 }
9696
9797 // Create tool input schema
You can’t perform that action at this time.
0 commit comments