File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[project ]
22name = " gumloop-mcp"
3- version = " 0.1.6 "
3+ version = " 0.1.8 "
44description = " guMCP (Gumloop Model Context Protocol) SDK"
55readme = " README.md"
66requires-python = " >=3.10"
Original file line number Diff line number Diff line change @@ -519,6 +519,14 @@ async def handler(req: types.ListToolsRequest):
519519 # Filter deprecated properties from all tools
520520 tools = [filter_deprecated_properties_from_tool (tool ) for tool in tools ]
521521
522+ # Filter restricted tools
523+ if hasattr (self , "config" ) and self .config is not None :
524+ restricted_tools = self .config .get ("restricted_tools" , [])
525+ if restricted_tools :
526+ tools = [
527+ tool for tool in tools if tool .name not in restricted_tools
528+ ]
529+
522530 # Filter for external clients
523531 if hasattr (self , "config" ) and self .config is not None :
524532 if self .config .get ("external_client" , False ):
@@ -606,6 +614,14 @@ async def handler(req: types.CallToolRequest):
606614 f"Input validation error: { e .message } "
607615 )
608616
617+ # Check if tool is restricted
618+ if hasattr (self , "config" ) and self .config is not None :
619+ restricted_tools = self .config .get ("restricted_tools" , [])
620+ if tool_name in restricted_tools :
621+ return self ._make_error_result (
622+ f"Tool '{ tool_name } ' is restricted and cannot be used"
623+ )
624+
609625 # tool call
610626 results = await func (tool_name , arguments )
611627 content = list (results )
You can’t perform that action at this time.
0 commit comments