Skip to main content
Glama

list_examples

Read-only

Browse available Ilograph example diagrams to learn diagram creation, with filtering by complexity level to find suitable starting points.

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

  • Registers the list_examples tool using the @mcp.tool decorator, specifying name, title, readOnlyHint, and description.
    @mcp.tool(
        name="list_examples",
        annotations={
            "title": "List Available Example Diagrams",
            "readOnlyHint": True,
            "description": "Lists available Ilograph example diagrams with their categories and descriptions.",
        },
    )
  • Implements the core logic of the list_examples tool: filters examples by optional category parameter, formats summaries, and returns list or error message.
    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'.",
        }
  • Pydantic BaseModel defining the structure of example metadata, used in the database and for serializing responses.
    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)
    
        @property
        def file_path(self) -> Path:
            """Returns the full path to the example file."""
            return EXAMPLES_DIR / self.name
  • Utility function to generate a concise summary dictionary from ExampleMetadata instance.
    def _get_example_summary(metadata: ExampleMetadata) -> Dict[str, Any]:
        """Returns a concise summary of an example."""
        return metadata.model_dump(include={"name", "category", "description"})
  • Calls register_example_tools(mcp) during server initialization to register the list_examples tool among others.
    register_example_tools(mcp)
Behavior3/5

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

Annotations provide readOnlyHint=true, indicating this is a safe read operation. The description adds value by specifying that it lists 'available' examples and includes optional filtering, which gives context beyond the annotations. However, it doesn't disclose behavioral traits like pagination, rate limits, or error handling, leaving gaps in transparency.

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 highly concise and well-structured: it starts with the core purpose, followed by parameter and return value explanations in separate sections. Every sentence adds value without redundancy, and it's front-loaded with the main functionality. No wasted words or unnecessary details.

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

Completeness3/5

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

Given the tool's low complexity (1 optional parameter, read-only operation) and no output schema, the description is minimally adequate. It covers the purpose, parameter semantics, and return value, but lacks details on usage context, error cases, or behavioral nuances. With annotations covering safety, it meets baseline completeness but has clear gaps.

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 adds meaningful context for the single parameter 'category' by explaining it filters examples by complexity levels ('beginner', 'intermediate', 'advanced'), which isn't covered in the input schema (0% schema description coverage). This compensates well for the lack of schema descriptions, though it doesn't detail default behavior or null handling explicitly.

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

Purpose4/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: 'Lists available Ilograph example diagrams' with optional filtering by category. It specifies the verb ('Lists') and resource ('Ilograph example diagrams'), making the action and target clear. However, it doesn't explicitly differentiate from sibling tools like 'fetch_example' or 'list_documentation_sections', which prevents a perfect score.

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 provides no guidance on when to use this tool versus alternatives. It mentions optional filtering by category but doesn't explain when to use this versus other listing tools (e.g., 'list_documentation_sections') or fetching tools (e.g., 'fetch_example'). There's no context about prerequisites, exclusions, or typical scenarios for usage.

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