Skip to content

Commit 0c8937d

Browse files
committed
Remove unused block parameters
There are some unused block variables. This change removes block parameters that consist solely of unused block parameters. Where `Hash#values` suffices instead of ignoring unused variables, replace such code with `Hash#values`.
1 parent a17b23e commit 0c8937d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/mcp/server.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def init(request)
253253
end
254254

255255
def list_tools(request)
256-
@tools.map { |_, tool| tool.to_h }
256+
@tools.values.map(&:to_h)
257257
end
258258

259259
def call_tool(request)
@@ -293,7 +293,7 @@ def call_tool(request)
293293
end
294294

295295
def list_prompts(request)
296-
@prompts.map { |_, prompt| prompt.to_h }
296+
@prompts.values.map(&:to_h)
297297
end
298298

299299
def get_prompt(request)

test/mcp/server/transports/stdio_notification_integration_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def puts(message)
210210
@server.define_prompt(
211211
name: "test_prompt",
212212
description: "Test prompt",
213-
) do |_args, _server_context:|
213+
) do
214214
MCP::PromptResponse.new(messages: [{ role: "user", content: "Test" }])
215215
end
216216

test/mcp/server_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ServerTest < ActiveSupport::TestCase
3737
arguments: [
3838
Prompt::Argument.new(name: "test_argument", description: "Test argument", required: true),
3939
],
40-
) do |_|
40+
) do
4141
Prompt::Result.new(
4242
description: "Hello, world!",
4343
messages: [

test/mcp/tool_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class InputSchemaTool < Tool
123123
name: "mock_tool",
124124
title: "Mock Tool",
125125
description: "a mock tool for testing",
126-
) do |_|
126+
) do
127127
Tool::Response.new([{ type: "text", content: "OK" }])
128128
end
129129

@@ -141,7 +141,7 @@ class InputSchemaTool < Tool
141141
read_only_hint: true,
142142
title: "Mock Tool",
143143
},
144-
) do |_|
144+
) do
145145
Tool::Response.new([{ type: "text", content: "OK" }])
146146
end
147147

@@ -347,7 +347,7 @@ class OutputSchemaObjectTool < Tool
347347
title: "Mock Tool",
348348
description: "a mock tool for testing",
349349
output_schema: { properties: { result: { type: "string" } }, required: ["result"] },
350-
) do |_|
350+
) do
351351
Tool::Response.new([{ type: "text", content: "OK" }])
352352
end
353353

0 commit comments

Comments
 (0)