Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/mcp/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/mcp/server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
6 changes: 3 additions & 3 deletions test/mcp/tool_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -141,7 +141,7 @@ class InputSchemaTool < Tool
read_only_hint: true,
title: "Mock Tool",
},
) do |_|
) do
Tool::Response.new([{ type: "text", content: "OK" }])
end

Expand Down Expand Up @@ -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

Expand Down