Skip to main content
Glama

search_icons_tool

Read-only

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."""
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, but the description adds valuable behavioral context beyond that: it specifies that the search uses 'semantic matching', fetches from a 'live icon catalog', and provides 'intelligent search capabilities'. This gives the agent insight into the tool's functionality that annotations alone don't provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized, with a clear purpose statement followed by parameter explanations and return value details. Every sentence adds value, and the information is front-loaded with the most important details first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, the description provides complete context: it explains the tool's purpose, parameters, and return format in detail. While there's no output schema, the description thoroughly documents the return structure, making the tool fully understandable to an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining both parameters: 'query' is described as a search term with concrete examples, and 'provider' is explained as an optional filter with specific allowed values. This adds crucial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('searches', 'fetches') and resources ('icon catalog', 'Ilograph'), and distinguishes it from sibling tools by focusing on icon search rather than documentation, examples, or validation functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (searching for icons in Ilograph diagrams), but doesn't explicitly state when not to use it or name specific alternatives among the sibling tools, though the distinction is implied by the tool's unique focus.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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