feat: add wildcard support for tool capabilities#901
Open
neo-wanderer wants to merge 1 commit intoRightNow-AI:mainfrom
Open
feat: add wildcard support for tool capabilities#901neo-wanderer wants to merge 1 commit intoRightNow-AI:mainfrom
neo-wanderer wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
Implement prefix wildcard matching in capabilities.tools to allow patterns like 'mcp_filesystem_*' to grant permission to all matching MCP tools. Changes: - Add tool_matches_pattern() helper supporting exact match, prefix wildcard (*), and universal wildcard (*) - Update builtin tools, skill tools, MCP tools, and profile-based filtering - Add unit tests in kernel.rs (5 new tests) - Update docs: troubleshooting.md, getting-started.md, agent-templates.md, mcp-a2a.md with wildcard syntax examples This resolves the common issue where agents can't use MCP tools even after configuring mcp_servers, because tool permissions require explicit grants.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
capabilities.toolsto allow patterns like"mcp_filesystem_*"to grant permission to all matching MCP toolstool_matches_pattern()helper function supporting exact match, prefix wildcard (*), and universal wildcard (*)available_tools_with_registryfor builtin tools, skill tools, MCP tools, and profile-based filteringProblem
When agents configure MCP servers in
config.toml, they still get "Permission denied" errors because tool permissions require explicit grants in the agent manifest. Listing each MCP tool individually is tedious:Solution
Use wildcard patterns to grant access to all matching tools:
Changes
crates/openfang-kernel/src/kernel.rs- Implementation + testsdocs/troubleshooting.md- Added wildcard examplesdocs/getting-started.md- Added note about wildcardsdocs/agent-templates.md- Added comment about wildcardsdocs/mcp-a2a.md- Added "Granting MCP Tool Access" sectionTesting
cargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepassesSecurity