active_mcp 0.10.4 → 0.10.5
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 +2 -2
- data/lib/active_mcp/completion.rb +2 -2
- data/lib/active_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: f7a6dec91d1f48ced13dc1699bf78b251961a4dfaf41b1c95531465c618c3ba2
|
4
|
+
data.tar.gz: e21b02b26027a3d87c44231f4cf7076febd82746e4a222fe1112a8b6b650ba12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eace2e1b1abdfca71fe7884d654e8d698a07e0c1f175462db46a80f798e2b8a31d2561a8b3c95f558ed3d3f374ab3013f341d3eb3733e79d6f9650617ac05137
|
7
|
+
data.tar.gz: 231879557b7ec110bf2810e0ee66566cbd1bc791d695bff869b9ac197c67cfdba16e3aea1aa1fd5b2821517c99726f50d3698cdd27d499d76fa165584d7e6b72
|
data/README.md
CHANGED
@@ -482,7 +482,7 @@ class UserResource < ActiveMcp::Resource::Base
|
|
482
482
|
end
|
483
483
|
end
|
484
484
|
|
485
|
-
argument :id, complete: ->(value) do
|
485
|
+
argument :id, complete: ->(value, context) do
|
486
486
|
User.all.pluck(:id).filter { _1.match(value) }
|
487
487
|
end
|
488
488
|
|
@@ -528,7 +528,7 @@ Resources are Ruby classes `**Prompt`:
|
|
528
528
|
|
529
529
|
```ruby
|
530
530
|
class HelloPrompt < ActiveMcp::Prompt::Base
|
531
|
-
argument :name, required: true, description: "User name", complete: ->(value) do
|
531
|
+
argument :name, required: true, description: "User name", complete: ->(value, context) do
|
532
532
|
User.all.pluck(:name).filter { _1.match(value) }
|
533
533
|
end
|
534
534
|
|
@@ -8,11 +8,11 @@ module ActiveMcp
|
|
8
8
|
|
9
9
|
if uri_template
|
10
10
|
resource_class = refs.find { _1.uri_template == uri_template }
|
11
|
-
values = resource_class.arguments[arg_name.to_sym].call(value)
|
11
|
+
values = resource_class.arguments[arg_name.to_sym].call(value, context)
|
12
12
|
{values:, total: values.length}
|
13
13
|
elsif ref_name
|
14
14
|
prompt = refs.find { _1.prompt_name == ref_name }
|
15
|
-
values = prompt.class.arguments.find { _1[:name] == arg_name.to_sym }[:complete].call(value)
|
15
|
+
values = prompt.class.arguments.find { _1[:name] == arg_name.to_sym }[:complete].call(value, context)
|
16
16
|
{values:, total: values.length}
|
17
17
|
end
|
18
18
|
end
|
data/lib/active_mcp/version.rb
CHANGED