Skip to content

Commit c558d87

Browse files
committed
Add optional title property for tool object (#191)
1 parent b19d9f1 commit c558d87

File tree

4 files changed

+341
-7
lines changed

4 files changed

+341
-7
lines changed

src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/Server.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ public open class Server(
206206
* Registers a single tool. The client can then call this tool.
207207
*
208208
* @param name The name of the tool.
209+
* @param title An optional human-readable name of the tool for display purposes.
209210
* @param description A human-readable description of what the tool does.
210211
* @param inputSchema The expected input schema for the tool.
211212
* @param outputSchema The optional expected output schema for the tool.
@@ -217,11 +218,12 @@ public open class Server(
217218
name: String,
218219
description: String,
219220
inputSchema: Tool.Input = Tool.Input(),
221+
title: String? = null,
220222
outputSchema: Tool.Output? = null,
221223
toolAnnotations: ToolAnnotations? = null,
222224
handler: suspend (CallToolRequest) -> CallToolResult
223225
) {
224-
val tool = Tool(name, description, inputSchema, outputSchema, toolAnnotations)
226+
val tool = Tool(name, title, description, inputSchema, outputSchema, toolAnnotations)
225227
addTool(tool, handler)
226228
}
227229

src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,10 @@ public data class Tool(
11101110
* The name of the tool.
11111111
*/
11121112
val name: String,
1113+
/**
1114+
* The title of the tool.
1115+
*/
1116+
val title: String?,
11131117
/**
11141118
* A human-readable description of the tool.
11151119
*/

0 commit comments

Comments
 (0)