[Doc] Fix incorrect examples in README.md
This PR fixes incorrect examples in README.md. The block variable could be removed if it is unused, but when presenting an example `:server_context` should still be shown as a keyword argument. Fixes #185.
This commit is contained in:
parent
d31c3da8f2
commit
dacd5f1741
1 changed files with 3 additions and 3 deletions
|
|
@ -434,7 +434,7 @@ tool = MCP::Tool.define(
|
||||||
read_only_hint: true,
|
read_only_hint: true,
|
||||||
title: "My Tool"
|
title: "My Tool"
|
||||||
}
|
}
|
||||||
) do |args, server_context|
|
) do |args, server_context:|
|
||||||
MCP::Tool::Response.new([{ type: "text", text: "OK" }])
|
MCP::Tool::Response.new([{ type: "text", text: "OK" }])
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
@ -450,7 +450,7 @@ server.define_tool(
|
||||||
title: "My Tool",
|
title: "My Tool",
|
||||||
read_only_hint: true
|
read_only_hint: true
|
||||||
}
|
}
|
||||||
) do |args, server_context|
|
) do |args, server_context:|
|
||||||
Tool::Response.new([{ type: "text", text: "OK" }])
|
Tool::Response.new([{ type: "text", text: "OK" }])
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
@ -540,7 +540,7 @@ tool = MCP::Tool.define(
|
||||||
},
|
},
|
||||||
required: ["mean", "median", "count"]
|
required: ["mean", "median", "count"]
|
||||||
}
|
}
|
||||||
) do |args, server_context|
|
) do |args, server_context:|
|
||||||
# Calculate statistics and validate against schema
|
# Calculate statistics and validate against schema
|
||||||
MCP::Tool::Response.new([{ type: "text", text: "Statistics calculated" }])
|
MCP::Tool::Response.new([{ type: "text", text: "Statistics calculated" }])
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue