diff --git a/lib/mcp/server.rb b/lib/mcp/server.rb index 2e8625a0..74f6bd00 100644 --- a/lib/mcp/server.rb +++ b/lib/mcp/server.rb @@ -253,7 +253,7 @@ def init(request) end def list_tools(request) - @tools.map { |_, tool| tool.to_h } + @tools.values.map(&:to_h) end def call_tool(request) @@ -293,7 +293,7 @@ def call_tool(request) end def list_prompts(request) - @prompts.map { |_, prompt| prompt.to_h } + @prompts.values.map(&:to_h) end def get_prompt(request) diff --git a/test/mcp/server/transports/stdio_notification_integration_test.rb b/test/mcp/server/transports/stdio_notification_integration_test.rb index 745aa4ad..6030e4b0 100644 --- a/test/mcp/server/transports/stdio_notification_integration_test.rb +++ b/test/mcp/server/transports/stdio_notification_integration_test.rb @@ -210,7 +210,7 @@ def puts(message) @server.define_prompt( name: "test_prompt", description: "Test prompt", - ) do |_args, _server_context:| + ) do MCP::PromptResponse.new(messages: [{ role: "user", content: "Test" }]) end diff --git a/test/mcp/server_test.rb b/test/mcp/server_test.rb index 4529506d..58b3a36c 100644 --- a/test/mcp/server_test.rb +++ b/test/mcp/server_test.rb @@ -37,7 +37,7 @@ class ServerTest < ActiveSupport::TestCase arguments: [ Prompt::Argument.new(name: "test_argument", description: "Test argument", required: true), ], - ) do |_| + ) do Prompt::Result.new( description: "Hello, world!", messages: [ diff --git a/test/mcp/tool_test.rb b/test/mcp/tool_test.rb index 1fcbb61c..47310362 100644 --- a/test/mcp/tool_test.rb +++ b/test/mcp/tool_test.rb @@ -123,7 +123,7 @@ class InputSchemaTool < Tool name: "mock_tool", title: "Mock Tool", description: "a mock tool for testing", - ) do |_| + ) do Tool::Response.new([{ type: "text", content: "OK" }]) end @@ -141,7 +141,7 @@ class InputSchemaTool < Tool read_only_hint: true, title: "Mock Tool", }, - ) do |_| + ) do Tool::Response.new([{ type: "text", content: "OK" }]) end @@ -347,7 +347,7 @@ class OutputSchemaObjectTool < Tool title: "Mock Tool", description: "a mock tool for testing", output_schema: { properties: { result: { type: "string" } }, required: ["result"] }, - ) do |_| + ) do Tool::Response.new([{ type: "text", content: "OK" }]) end