Skip to main content
Glama

list_flet_controls

Discover all available Flet UI controls to identify which interface elements can be built.

Instructions

Get a complete list of all available Flet UI controls. Use this to discover what UI elements can be built in Flet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool registration and handler: decorated with @mcp.tool(), this is the MCP entry point that delegates to docs_fetcher.list_flet_controls().
    @mcp.tool()
    async def list_flet_controls() -> list[str]:
        """
        Get a complete list of all available Flet UI controls.
        Use this to discover what UI elements can be built in Flet.
        """
        return await docs_fetcher.list_flet_controls()
  • The actual implementation logic in FletDocsFetcher class: fetches the GitHub repo tree via get_docs_tree(), filters paths under 'website/docs/controls/', extracts control names, deduplicates, and returns sorted list.
    async def list_flet_controls(self) -> list[str]:
        """Returns a list of all available Flet UI controls."""
        all_docs = await self.get_docs_tree()
        
        # Filter only the files that live in the controls directory
        controls = []
        for path in all_docs:
            if "website/docs/controls/" in path:
                # Extract just the control name from the path (e.g., 'dropdown/index.md' -> 'dropdown')
                parts = path.split("website/docs/controls/")
                if len(parts) > 1:
                    clean_name = parts[1].split("/")[0].replace(".md", "")
                    if clean_name not in controls:
                        controls.append(clean_name)
        
        return sorted(controls)
  • Helper method get_docs_tree() called by list_flet_controls: uses GitHub Tree API to recursively fetch all file paths, then filters for Markdown files under website/docs/.
    async def get_docs_tree(self) -> list[str]:
        """Gets a flat list of all Markdown documentation paths in the Flet repo."""
        # The Tree API is the most efficient way to get all files in a repo at once
        repo_api_url = "https://api.github.com/repos/flet-dev/flet/git/trees/main?recursive=1"
        data = await self._fetch_json(repo_api_url)
    
        if not data or "tree" not in data:
            return []
    
        # Filter out everything except markdown files in the docs folder
        doc_paths = [
            item["path"] for item in data["tree"]
            if item["path"].startswith("website/docs/") and item["path"].endswith(".md")
        ]
        return doc_paths
  • Test case verifying list_flet_controls returns >100 controls and includes 'dropdown'.
    @pytest.mark.asyncio
    async def test_list_flet_controls(docs_fetcher):
        controls = await docs_fetcher.list_flet_controls()
        assert len(controls) > 100
        assert "dropdown" in controls
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It states the tool returns a 'complete list' but does not elaborate on behavior like whether the list is exhaustive, cached, or has pagination. However, the output schema exists to clarify the return structure.

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 two sentences, concise and front-loaded with the action. Every sentence adds value, with no wasted words.

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?

For a simple list tool with zero parameters and an output schema present, the description is complete. It states what the tool does and when to use it, and the output schema covers return values.

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 tool has 0 parameters and schema coverage is 100%. Per guidelines, baseline is 4. The description adds no parameter information, which is acceptable since there are none to describe.

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 returns a complete list of all available Flet UI controls, with a specific verb ('get') and resource ('list of controls'). It is distinguishable from sibling tools like get_flet_doc which provide details on individual controls.

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?

It explicitly says to use this tool to discover what UI elements can be built. While it doesn't mention when not to use it or provide alternatives, the context is clear and sufficient for a simple listing tool with no parameters.

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/Nwokike/flet-mcp-server'

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