Commit graph ruby-sdk/test/mcp/tool/annotations_test.rb
Author SHA1 Message Date
Koichi ITO
cae30547d2 Set default values for ToolAnnotations hints
According to the specification, `destructive_hint`, `idempotent_hint`, `open_world_hint`,
and `read_only_hint` of `ToolAnnotations` are optional with default values:
https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations

This PR sets their default values in accordance with the specification.

Additionally, for readability, the hints have been reordered to follow the specification.
2025-08-28 01:13:57 +09:00
Koichi ITO
092aebf1a4 Extract MCP::Tool::Annotations unit tests
The tests related to `MCP::Tool::Annotations` will be extracted from the `MCP::ToolTest` test class
into a dedicated `MCP::Tool::AnnotationsTest` unit test class as a testing pair.

This improves test clarity, file level test independence, and file level execution speed.
It also ensures consistent placement as a testing pair under `MCP::Tool::*`:

```console
$ ls lib/mcp/tool/
annotations.rb  input_schema.rb  response.rb
$ ls test/mcp/tool/
annotations_test.rb  input_schema_test.rb  response_test.rb
```
2025-08-27 13:33:21 +09:00