@@ -151,3 +151,40 @@ def test_additional_properties_false_parsing(client: BasicMCPClient):
151151 assert tool_spec ._is_simple_object (schema_dict )
152152 result_type = tool_spec ._create_dict_type (schema_dict , {})
153153 assert result_type == Dict [str , str ]
154+
155+
156+ @pytest .mark .asyncio
157+ async def test_resource_tool_uses_uri_not_name (client : BasicMCPClient ):
158+ """
159+ Tests that a tool from a static resource is executable.
160+
161+ This test is designed to FAIL with the current bug, because the tool's
162+ internal function is created with the resource's name ('get_app_config')
163+ instead of its URI ('config://app'), causing the client call to fail.
164+ """
165+ tool_spec = McpToolSpec (
166+ client , allowed_tools = ["get_app_config" ], include_resources = True
167+ )
168+ tools = await tool_spec .to_tool_list_async ()
169+
170+ assert len (tools ) == 1
171+ tool = tools [0 ]
172+ assert tool .metadata .name == "get_app_config"
173+
174+ # This call will fail due to the bug.
175+ result = await tool .acall ()
176+ assert "MCP Test Server" in result .content
177+
178+
179+ @pytest .mark .asyncio
180+ async def test_dynamic_resource_template_tool_is_created (client : BasicMCPClient ):
181+ """
182+ Tests that a tool is created for a dynamic resource template.
183+ """
184+ tool_spec = McpToolSpec (client , include_resources = True )
185+ tools = await tool_spec .to_tool_list_async ()
186+
187+ # The server.py defines a dynamic resource template named 'get_user_profile'.
188+ # This should now be found.
189+ tool_names = {t .metadata .name for t in tools }
190+ assert "get_user_profile" in tool_names
0 commit comments