diff --git a/contributing/samples/mcp_agent/agent.py b/contributing/samples/mcp_agent/agent.py index 660c98c..a14ab43 100755 --- a/contributing/samples/mcp_agent/agent.py +++ b/contributing/samples/mcp_agent/agent.py @@ -19,10 +19,16 @@ from google.adk.agents.llm_agent import LlmAgent from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset from google.adk.tools.mcp_tool.mcp_toolset import StdioServerParameters +_allowed_path = os.path.dirname(os.path.abspath(__file__)) + root_agent = LlmAgent( model='gemini-2.0-flash', name='enterprise_assistant', - instruction='Help user accessing their file systems', + instruction=f"""\ +Help user accessing their file systems. + +Allowed directory: {_allowed_path} + """, tools=[ MCPToolset( connection_params=StdioServerParameters( @@ -30,7 +36,7 @@ root_agent = LlmAgent( args=[ '-y', # Arguments for the command '@modelcontextprotocol/server-filesystem', - os.path.dirname(os.path.abspath(__file__)), + _allowed_path, ], ), # don't want agent to do write operation