Skip to main content
Glama

search_icons_tool

Find appropriate icons for Ilograph diagrams by searching the live icon catalog with semantic matching. Filter results by cloud provider or category to locate specific diagram resources.

Instructions

Searches the current icon catalog with semantic matching. This tool fetches the live icon catalog from Ilograph and provides intelligent search capabilities to help find appropriate icons for diagram resources. Args: query: Search term (e.g., 'database', 'aws lambda', 'kubernetes', 'storage') provider: Optional filter by provider ('AWS', 'Azure', 'GCP', 'Networking') Returns: list: Matching icons with paths, categories, and usage information. Each icon dict contains: - path: The icon path for use in Ilograph diagrams - provider: The cloud provider or category (AWS, Azure, GCP, Networking) - category: The service category (e.g., 'Compute', 'Database', 'Analytics') - name: The specific icon name - usage: Example usage string for Ilograph diagrams

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
providerNo

Implementation Reference

  • The core handler function that implements the search_icons_tool logic: validates query and provider, fetches icons using the fetcher, handles errors and empty results, and returns a list of matching icon dictionaries.
    async def search_icons_tool( query: str, provider: Optional[str] = None, ctx: Optional[Context] = None ) -> List[Dict[str, Any]]: """ Searches the current icon catalog with semantic matching. This tool fetches the live icon catalog from Ilograph and provides intelligent search capabilities to help find appropriate icons for diagram resources. Args: query: Search term (e.g., 'database', 'aws lambda', 'kubernetes', 'storage') provider: Optional filter by provider ('AWS', 'Azure', 'GCP', 'Networking') Returns: list: Matching icons with paths, categories, and usage information. Each icon dict contains: - path: The icon path for use in Ilograph diagrams - provider: The cloud provider or category (AWS, Azure, GCP, Networking) - category: The service category (e.g., 'Compute', 'Database', 'Analytics') - name: The specific icon name - usage: Example usage string for Ilograph diagrams """ # Validate input parameters if not query or not isinstance(query, str): error_msg = "Query parameter is required and must be a non-empty string" if ctx: await ctx.error(error_msg) return [{"error": error_msg}] query = query.strip().lower() if not query: error_msg = "Query parameter cannot be empty or only whitespace" if ctx: await ctx.error(error_msg) return [{"error": error_msg}] # Normalize and validate provider filter if provider: provider = provider.strip() valid_providers = ["AWS", "Azure", "GCP", "Networking"] if provider not in valid_providers: error_msg = ( f"Invalid provider '{provider}'. Valid providers: {', '.join(valid_providers)}" ) if ctx: await ctx.error(error_msg) return [{"error": error_msg}] try: # Log the search request provider_filter = f" (filtered by {provider})" if provider else "" if ctx: await ctx.info(f"Searching Ilograph icons for '{query}'{provider_filter}") # Get fetcher instance fetcher = get_fetcher() # Search icons icons = await fetcher.search_icons(query, provider) if icons is None: error_msg = ( "Failed to fetch icon catalog. The service may be temporarily unavailable." ) if ctx: await ctx.error(error_msg) return [{"error": error_msg}] if not icons: # No matches found provider_note = f" in {provider}" if provider else "" if ctx: await ctx.info(f"No icons found matching '{query}'{provider_note}") return [ { "message": f"No icons found matching '{query}'{provider_note}", "suggestion": "Try broader search terms like 'database', 'compute', 'storage', or 'network'", "available_providers": ["AWS", "Azure", "GCP", "Networking"], } ] # Log successful search result_count = len(icons) if ctx: await ctx.info(f"Found {result_count} icons matching '{query}'{provider_filter}") return icons except Exception as e: error_msg = f"Unexpected error searching icons: {str(e)}" if ctx: await ctx.error(error_msg) return [ { "error": "An unexpected error occurred while searching icons. Please try again later." } ]
  • The @mcp.tool decorator annotations, function signature with type hints, and docstring define the tool's input schema (query: str, optional provider: str), output type (List[Dict]), title, and description.
    @mcp.tool( annotations={ "title": "Search Ilograph Icons", "readOnlyHint": True, "description": "Searches the live icon catalog with semantic matching and provider filtering", } ) async def search_icons_tool( query: str, provider: Optional[str] = None, ctx: Optional[Context] = None ) -> List[Dict[str, Any]]: """ Searches the current icon catalog with semantic matching. This tool fetches the live icon catalog from Ilograph and provides intelligent search capabilities to help find appropriate icons for diagram resources. Args: query: Search term (e.g., 'database', 'aws lambda', 'kubernetes', 'storage') provider: Optional filter by provider ('AWS', 'Azure', 'GCP', 'Networking') Returns: list: Matching icons with paths, categories, and usage information. Each icon dict contains: - path: The icon path for use in Ilograph diagrams - provider: The cloud provider or category (AWS, Azure, GCP, Networking) - category: The service category (e.g., 'Compute', 'Database', 'Analytics') - name: The specific icon name - usage: Example usage string for Ilograph diagrams """ # Validate input parameters
  • Invocation of register_fetch_icons_tool(mcp) in the server creation, which defines and registers the search_icons_tool via FastMCP decorator.
    register_fetch_icons_tool(mcp) logger.info("Registered fetch_icons_tool")
  • The register_fetch_icons_tool function that uses @mcp.tool decorator to register search_icons_tool and list_icon_providers_tool on the FastMCP instance.
    def register_fetch_icons_tool(mcp: FastMCP) -> None: """Register the fetch icons tool with the FastMCP server."""

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/QuincyMillerDev/ilograph-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server