fix: hide direct-only abilities from the adapter meta-tools

This commit is contained in:
2026-09-26 05:05:48 +02:00
parent 8d0979cb73
commit 648d53cb96
2 changed files with 25 additions and 1 deletions
+7 -1
View File
@@ -85,7 +85,13 @@ final class AbilityRegistrar
'meta' => [
'annotations' => $ability->annotations(),
'show_in_rest' => false,
'mcp' => ['public' => true, 'type' => 'tool'],
// mcp.public only governs the adapter's meta-tools (discover/get-info/execute);
// direct tools are listed on the server explicitly. Direct-only abilities
// (image/resource results) would not work through execute, so hide them there.
'mcp' => [
'public' => ! in_array($ability->name(), ExposurePolicy::DIRECT_ONLY, true),
'type' => 'tool',
],
],
];