Skip to content

fix(agents): apply custom tool limits to mcp tools#313

Open
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-custom-agent-mcp-tool-restrictions
Open

fix(agents): apply custom tool limits to mcp tools#313
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-custom-agent-mcp-tool-restrictions

Conversation

@OnlyYu1996
Copy link
Copy Markdown

Summary

  • apply custom agent tool restrictions to dynamic MCP tool names (mcp__server__tool)
  • add an mcp category-level switch used by AgentInfo::is_tool_enabled() for dynamic MCP tools
  • keep tools: mcp, tools: all, and explicit mcp__... entries working for agents that intentionally allow MCP access
  • add regression coverage for read-only, all, mcp-only, category-level, and single-tool MCP behavior

Fixes PlatformNetwork/bounty-challenge#53245.

Validation

  • cargo +1.90.0 fmt --package cortex-agents --check
  • git diff --check

I also attempted cargo +1.90.0 test -p cortex-agents test_read_only_agent_disables_mcp_tools, but this local Windows/MSVC environment fails before reaching the crate tests while compiling the workspace aws-lc-sys dependency (cl.exe fails compiling aws-lc/crypto/fipsmodule/bcm.c).

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Custom agents with restricted tools never disable MCP tools — ToolCategory::All excludes MCP, so MCP tools bypass the disable loop entirely

1 participant