Merge branch 'main' into auto-determine-capabilities
This commit is contained in:
commit
00e1ed8fec
1 changed files with 25 additions and 3 deletions
|
|
@ -51,6 +51,7 @@ module ModelContextProtocol
|
|||
|
||||
@server = Server.new(
|
||||
name: @server_name,
|
||||
version: "1.2.3",
|
||||
tools: [@tool, @tool_that_raises],
|
||||
prompts: [@prompt],
|
||||
resources: [@resource],
|
||||
|
|
@ -120,7 +121,7 @@ module ModelContextProtocol
|
|||
},
|
||||
"serverInfo": {
|
||||
"name": @server_name,
|
||||
"version": ModelContextProtocol::VERSION,
|
||||
"version": "1.2.3",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -648,6 +649,18 @@ module ModelContextProtocol
|
|||
assert_equal Configuration::DEFAULT_PROTOCOL_VERSION, response[:result][:protocolVersion]
|
||||
end
|
||||
|
||||
test "server uses default version when not configured" do
|
||||
server = Server.new(name: "test_server")
|
||||
request = {
|
||||
jsonrpc: "2.0",
|
||||
method: "initialize",
|
||||
id: 1,
|
||||
}
|
||||
|
||||
response = server.handle(request)
|
||||
assert_equal Server::DEFAULT_VERSION, response[:result][:serverInfo][:version]
|
||||
end
|
||||
|
||||
test "#define_tool adds a tool to the server" do
|
||||
@server.define_tool(
|
||||
name: "defined_tool",
|
||||
|
|
|
|||
Loading…
Reference in a new issue