hub_kernel-mcp 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdf5562d9d62588f25ee064ae1571430d08a6ac2c452b957b1df4784f5c9cc1d
4
- data.tar.gz: e122d851e02746457f5f4232eb118f3a2cd21100fb1931827f5af939c234076e
3
+ metadata.gz: 921598b05d30bf9e211477dbc575f7e59a8cde2487bdaa935e13242c7a80b5e7
4
+ data.tar.gz: d3e4111ecee2b448bee1120f7f9653b06c31bfd50d6a5143d622626fe42e7cc5
5
5
  SHA512:
6
- metadata.gz: 120c5a8941826f02ceea5d9cf251d3ec30e0061f4282010526fd067da2f5b7fdfde270d90900842b58cefed05aafb9decf8acb52c49d05131eaf8ab0fe4a499d
7
- data.tar.gz: 9082038898f81950d9a26c9973bc8d05e5d6769485d43f20eea358df2d274a388012fb3a1cd24393b88c73a4fecb2d3330e68923ec296f6ec34f6b0d9860b97c
6
+ metadata.gz: eeb8295b220d5cdc288ba99e991eeced8e0e5be262d7052a95715a4703e886ddb5db31f2369234a093fd2858ff08e89a2910a388c531121710058f09fbd83612
7
+ data.tar.gz: 73f9ce82ab316a2dbf92b912ba0676f871d311975b4f297c7cdb8a0e263c722c954c53705a23a779038494e7a1b2e48a1ffea254389c6ff2f64c0c8e1e624446
data/README.md CHANGED
@@ -40,9 +40,17 @@ Each tool is named `<hub>__<method>`, where the hub part is the name the hub is
40
40
  its input schema names the values the method takes:
41
41
 
42
42
  ```json
43
- { "name": "supplies__price_of", "inputSchema": { "type": "object", "properties": { "item": {} } } }
43
+ {
44
+ "name": "supplies__price_of",
45
+ "description": "Reads data from the supplies hub.",
46
+ "inputSchema": { "type": "object", "properties": { "item": {} } },
47
+ "annotations": { "readOnlyHint": true }
48
+ }
44
49
  ```
45
50
 
51
+ A tool for a method that writes has `readOnlyHint` set to false and a description saying it
52
+ changes data, so a client can ask before it calls one.
53
+
46
54
  `tools/call` runs the hub method a tool names, for the person and account the host's methods
47
55
  give, and returns the method's answer as JSON text:
48
56
 
@@ -33,7 +33,7 @@ module HubKernel
33
33
  end
34
34
  end
35
35
 
36
- def tool(served_name, exposure) = { name: "#{served_name}__#{exposure.name}", inputSchema: { type: "object", properties: exposure.takes.index_with { {} } } }
36
+ def tool(served_name, exposure) = { name: "#{served_name}__#{exposure.name}", description: description(served_name, exposure), inputSchema: { type: "object", properties: exposure.takes.index_with { {} } }, annotations: { readOnlyHint: !exposure.writes } }
37
37
 
38
38
  def called
39
39
  served_name, method_name = tool_name.split("__", 2)
@@ -48,6 +48,8 @@ module HubKernel
48
48
 
49
49
  def arguments = params.dig(:params, :arguments)&.to_unsafe_h.to_h.deep_symbolize_keys
50
50
 
51
+ def description(served_name, exposure) = exposure.writes ? "Changes data in the #{served_name} hub." : "Reads data from the #{served_name} hub."
52
+
51
53
  def caller_person = send(HubKernel::Mcp.person_method)
52
54
 
53
55
  def caller_account = send(HubKernel::Mcp.account_method)
@@ -1,5 +1,5 @@
1
1
  module HubKernel
2
2
  module Mcp
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_kernel-mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider