Skip to main content
Glama

list_examples

Read-only

List available example diagrams, optionally filtering by category to find beginner, intermediate, or advanced examples.

Instructions

    Lists available Ilograph example diagrams, optionally filtering by category.

    Args:
        category: Filter examples by complexity ('beginner', 'intermediate', 'advanced').

    Returns:
        A dictionary containing a list of available examples and a message guiding the user.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNo

Implementation Reference

  • The list_examples_tool async function - the actual handler that lists available example diagrams, optionally filtered by category.
    async def list_examples_tool(
        category: Optional[Literal["beginner", "intermediate", "advanced"]] = None,
    ) -> Dict[str, Any]:
        """
        Lists available Ilograph example diagrams, optionally filtering by category.
    
        Args:
            category: Filter examples by complexity ('beginner', 'intermediate', 'advanced').
    
        Returns:
            A dictionary containing a list of available examples and a message guiding the user.
        """
        examples_to_list: List[ExampleMetadata] = list(EXAMPLES_DATABASE.values())
        if category:
            examples_to_list = [ex for ex in examples_to_list if ex.category == category]
    
        if not examples_to_list:
            return {
                "message": f"No examples found for category '{category}'. Try again without a category to see all examples."
            }
    
        return {
            "examples": [_get_example_summary(ex) for ex in examples_to_list],
            "message": "To get the full content of an example, use the 'fetch_example' tool with its 'example_name'.",
        }
  • The ExampleMetadata Pydantic schema used for input/output validation of example data.
    class ExampleMetadata(BaseModel):
        """Defines the metadata structure for an Ilograph example."""
    
        name: str
        category: Literal["beginner", "intermediate", "advanced"]
        description: str
        learning_objectives: List[str] = Field(default_factory=list)
        patterns_demonstrated: List[str] = Field(default_factory=list)
  • The register_example_tools function that decorates the handler with @mcp.tool(name='list_examples') to register it with FastMCP.
    def register_example_tools(mcp: FastMCP) -> None:
        """Register the example diagram tools with the FastMCP server."""
    
        @mcp.tool(
            name="list_examples",
            annotations={
                "title": "List Available Example Diagrams",
                "readOnlyHint": True,
                "description": "Lists available Ilograph example diagrams with their categories and descriptions.",
            },
        )
  • The _get_example_summary helper function that returns a concise summary of an example (name, category, description).
    def _get_example_summary(metadata: ExampleMetadata) -> Dict[str, Any]:
        """Returns a concise summary of an example."""
        return metadata.model_dump(include={"name", "category", "description"})
  • The call to register_example_tools(mcp) in the main server creation function, which triggers registration of the list_examples tool.
    register_example_tools(mcp)
    logger.info("Registered example_tools")
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the read-only nature is covered. The description adds no further behavioral context beyond listing, such as error handling or behavior with null category. It is consistent with annotations.

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 concise with two sentences and a docstring outlining Args and Returns. Every sentence adds value, and the structure is front-loaded with the main action.

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

Completeness4/5

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

Given the simple tool with one optional parameter and no output schema, the description covers the purpose, parameter, and return structure adequately. It could mention default behavior (returns all when no category) but is sufficient for an agent.

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

Parameters4/5

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

The description explains the 'category' parameter by listing allowed values ('beginner', 'intermediate', 'advanced'), which adds meaning beyond the schema's enum. It also describes the return format as a dictionary with a list and message, compensating for the 0% schema description coverage.

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 that the tool lists Ilograph example diagrams with optional filtering by category. It uses specific verb 'lists' and identifies the resource 'example diagrams', distinguishing it from siblings like 'list_documentation_sections'.

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

Usage Guidelines2/5

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

The description mentions optional filtering by category but provides no guidance on when to use this tool versus alternatives like 'fetch_example' or 'list_documentation_sections'. No explicit when-to-use or when-not-to-use advice.

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