Last active
October 17, 2025 18:12
-
-
Save KyMidd/6e4e89cb308d42bc84b351070fef5cfd to your computer and use it in GitHub Desktop.
Helper function to apply prefixes to MCP tools
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
| def add_prefix_to_mcp_tools(tools, prefix): | |
| prefix = f"{prefix}_" | |
| return [PrefixedMCPTool(tool, prefix) for tool in tools] | |
| # Get tools from Azure MCP - | |
| azure_mcp_client, azure_tools = build_Azure_mcp_client(azure_client_id, azure_client_secret, azure_tenant_id) | |
| # Apply prefix - tools like 'search' become 'azure_search' | |
| azure_tools = add_prefix_to_mcp_tools(azure_tools, "azure") | |
| # Add to agent's tool list | |
| tools.extend(azure_tools) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment