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 +4 -4
- data/README.md +9 -1
- data/app/controllers/hub_kernel/mcp/messages_controller.rb +3 -1
- data/lib/hub_kernel/mcp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 921598b05d30bf9e211477dbc575f7e59a8cde2487bdaa935e13242c7a80b5e7
|
|
4
|
+
data.tar.gz: d3e4111ecee2b448bee1120f7f9653b06c31bfd50d6a5143d622626fe42e7cc5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
{
|
|
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)
|