Skip to main content
Glama

list_available_nodes

Read-onlyIdempotent

Browse available diagram nodes by provider, category, or search term to find valid components before creating diagrams.

Instructions

Discover 500+ node types across providers.

⚠️ USE THIS FIRST before create_diagram to avoid invalid node errors.

Filters: provider, category, search_term

Examples: AWS compute: provider="aws", category="compute" → EC2, Lambda, ECS, EKS... Search DBs: search_term="db" → RDS, DynamoDB, SQL across providers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
providerNoFilter by provider (aws, azure, gcp, etc.)
categoryNoFilter by category (compute, database, etc.)
search_termNoSearch term for node type names
limitNoMaximum results to return

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registers the 'list_available_nodes' tool with the MCP server, defining its name, description, input parameters schema via type hints, and annotations.
    @mcp.tool(
        name="list_available_nodes",
        description="""Discover 500+ node types across providers.
    
    ⚠️ USE THIS FIRST before create_diagram to avoid invalid node errors.
    
    Filters: provider, category, search_term
    
    Examples:
    AWS compute: provider="aws", category="compute" → EC2, Lambda, ECS, EKS...
    Search DBs: search_term="db" → RDS, DynamoDB, SQL across providers""",
        annotations={
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
        },
    )
  • The main handler function that implements the tool logic: accepts parameters, calls the search_nodes helper, formats the result using format_node_catalog, and handles errors.
    async def list_available_nodes(
        provider: Annotated[
            Optional[str], Field(description="Filter by provider (aws, azure, gcp, etc.)")
        ] = None,
        category: Annotated[
            Optional[str], Field(description="Filter by category (compute, database, etc.)")
        ] = None,
        search_term: Annotated[
            Optional[str], Field(description="Search term for node type names")
        ] = None,
        limit: Annotated[int, Field(description="Maximum results to return", ge=1, le=500)] = 100,
    ) -> str:
        """List available diagram node types."""
        try:
            # Search nodes
            nodes = search_nodes(
                provider=provider,
                category=category,
                search_term=search_term,
                limit=limit,
            )
    
            # Calculate total (for this implementation, returned = total due to limit)
            total_count = len(nodes)
            returned_count = len(nodes)
    
            return format_node_catalog(nodes, total_count, returned_count)
    
        except Exception as e:
            return format_error(f"Failed to list nodes: {str(e)}")
  • Core helper function that performs the node discovery and filtering logic by dynamically introspecting the 'diagrams' library modules using importlib and inspect.
    def search_nodes(
        provider: Optional[str] = None,
        category: Optional[str] = None,
        search_term: Optional[str] = None,
        limit: int = 100,
    ) -> List[Dict[str, str]]:
        """Search for nodes matching criteria using dynamic discovery.
    
        Args:
            provider: Optional provider filter
            category: Optional category filter
            search_term: Optional search term for node type
            limit: Maximum number of results to return
    
        Returns:
            List of matching nodes with their information
        """
        # Get discovered nodes (cached after first call)
        all_nodes = _discover_all_nodes()
    
        results = []
    
        # Determine which providers to search
        providers_to_search = [provider] if provider else all_nodes.keys()
    
        for prov in providers_to_search:
            if prov not in all_nodes:
                continue
    
            provider_nodes = all_nodes[prov]
    
            # Determine which categories to search
            categories_to_search = [category] if category else provider_nodes.keys()
    
            for cat in categories_to_search:
                if cat not in provider_nodes:
                    continue
    
                # Get nodes in this category
                nodes = provider_nodes[cat]
    
                for node in nodes:
                    # Apply search filter if provided
                    if search_term and search_term.lower() not in node.lower():
                        continue
    
                    node_info = get_node_info(prov, cat, node)
                    results.append(node_info)
    
                    if len(results) >= limit:
                        return results
    
        return results
Behavior4/5

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

The description adds valuable behavioral context beyond annotations. While annotations already indicate read-only, idempotent, and non-destructive behavior, the description provides practical guidance about using this tool first to avoid errors with create_diagram. It also mentions the scale ('500+ node types') and gives filtering examples. No contradiction with annotations exists.

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 efficiently structured with zero wasted sentences. It opens with the core purpose, provides critical usage guidance, lists filter parameters, and gives concrete examples. Each sentence adds clear value. The bullet-point style for examples enhances readability without verbosity.

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 complexity (discovering 500+ node types), the description provides complete context. With 100% schema coverage, comprehensive annotations, and an output schema (which means return values don't need description), the description focuses on what's missing: purpose, usage sequencing, and practical examples. It perfectly complements the structured data.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents all four parameters. The description mentions the three filter parameters (provider, category, search_term) and provides examples, but doesn't add significant semantic meaning beyond what's in the schema. The limit parameter isn't mentioned in the description. Baseline 3 is appropriate when schema does the heavy lifting.

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: 'Discover 500+ node types across providers.' It specifies the verb 'discover' and resource 'node types,' and distinguishes from siblings by explicitly mentioning its relationship to create_diagram. The first sentence provides a complete, specific purpose statement.

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

Usage Guidelines5/5

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

The description provides explicit guidance: 'USE THIS FIRST before create_diagram to avoid invalid node errors.' It names a specific sibling tool (create_diagram) and explains when to use this tool versus alternatives. The warning emoji reinforces the importance of this sequencing.

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/apetta/diagrams-mcp'

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