Merge pull request #84 from planio-gmbh/fix/implement-notifications-initialized
implements the notifications/initialized method
This commit is contained in:
commit
022b3ff640
2 changed files with 21 additions and 0 deletions
|
|
@ -74,6 +74,7 @@ module MCP
|
||||||
Methods::PROMPTS_GET => method(:get_prompt),
|
Methods::PROMPTS_GET => method(:get_prompt),
|
||||||
Methods::INITIALIZE => method(:init),
|
Methods::INITIALIZE => method(:init),
|
||||||
Methods::PING => ->(_) { {} },
|
Methods::PING => ->(_) { {} },
|
||||||
|
Methods::NOTIFICATIONS_INITIALIZED => ->(_) {},
|
||||||
|
|
||||||
# No op handlers for currently unsupported methods
|
# No op handlers for currently unsupported methods
|
||||||
Methods::RESOURCES_SUBSCRIBE => ->(_) {},
|
Methods::RESOURCES_SUBSCRIBE => ->(_) {},
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,26 @@ module MCP
|
||||||
assert_instrumentation_data({ method: "unsupported_method" })
|
assert_instrumentation_data({ method: "unsupported_method" })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "#handle notifications/initialized returns nil response" do
|
||||||
|
request = {
|
||||||
|
jsonrpc: "2.0",
|
||||||
|
method: "notifications/initialized",
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_nil @server.handle(request)
|
||||||
|
assert_instrumentation_data({ method: "notifications/initialized" })
|
||||||
|
end
|
||||||
|
|
||||||
|
test "#handle_json notifications/initialized returns nil response" do
|
||||||
|
request = JSON.generate({
|
||||||
|
jsonrpc: "2.0",
|
||||||
|
method: "notifications/initialized",
|
||||||
|
})
|
||||||
|
|
||||||
|
assert_nil @server.handle_json(request)
|
||||||
|
assert_instrumentation_data({ method: "notifications/initialized" })
|
||||||
|
end
|
||||||
|
|
||||||
test "#handle tools/list returns available tools" do
|
test "#handle tools/list returns available tools" do
|
||||||
request = {
|
request = {
|
||||||
jsonrpc: "2.0",
|
jsonrpc: "2.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue