Skip to main content
Glama

search_flet_docs

Locate the correct documentation file path by searching the official Flet index for a topic or control.

Instructions

Search the official Flet documentation index for a specific topic or control. Always use this first to find the correct file path before calling get_flet_doc.

Args: query: The keyword to search for (e.g., 'dropdown', 'navigation', 'layout').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async function `search_flet_docs` is decorated with @mcp.tool(), defining the tool. It accepts a `query` string and delegates to `docs_fetcher.search_docs(query)`.
    @mcp.tool()
    async def search_flet_docs(query: str) -> list[str]:
        """
        Search the official Flet documentation index for a specific topic or control.
        Always use this first to find the correct file path before calling get_flet_doc.
        
        Args:
            query: The keyword to search for (e.g., 'dropdown', 'navigation', 'layout').
        """
        return await docs_fetcher.search_docs(query)
  • The tool is registered via the `@mcp.tool()` decorator on the `search_flet_docs` function in the FastMCP server.
    @mcp.tool()
    async def search_flet_docs(query: str) -> list[str]:
        """
        Search the official Flet documentation index for a specific topic or control.
        Always use this first to find the correct file path before calling get_flet_doc.
        
        Args:
            query: The keyword to search for (e.g., 'dropdown', 'navigation', 'layout').
        """
        return await docs_fetcher.search_docs(query)
  • Type annotations and docstring define the input schema: a single `query: str` parameter (keyword to search for). Return type is `list[str]`.
    async def search_flet_docs(query: str) -> list[str]:
        """
        Search the official Flet documentation index for a specific topic or control.
        Always use this first to find the correct file path before calling get_flet_doc.
        
        Args:
            query: The keyword to search for (e.g., 'dropdown', 'navigation', 'layout').
        """
  • The `search_docs` method on `FletDocsFetcher` is the helper that performs the actual keyword search. It fetches the full docs tree via `get_docs_tree()`, then filters paths containing the query (case-insensitive).
    async def search_docs(self, query: str) -> list[str]:
        """A keyword search over the available document paths."""
        all_docs = await self.get_docs_tree()
        query_lower = query.lower()
    
        # Filter paths that contain the query string 
        # e.g., querying "dropdown" will match "docs/docs/controls/dropdown.md"
        matches = [path for path in all_docs if query_lower in path.lower()]
        return matches
  • The `get_docs_tree` method fetches the Git tree from the flet-dev/flet GitHub repo using the Trees API, returning a flat list of all Markdown file paths 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
Behavior2/5

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

No annotations exist, so description carries full burden. It discloses no behavioral traits such as result limits, error handling, or authentication needs. While simple search behavior may be assumed, lack of any disclosure lowers 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?

Two concise sentences plus a one-line Args section. Front-loaded with purpose, no redundant information. Every sentence adds value.

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 low complexity (1 param) and presence of an output schema, the description covers the main use case. However, it could improve by briefly hinting at what the output contains (e.g., file paths) to better support the workflow with get_flet_doc.

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?

Schema description coverage is 0%, but description adds concrete examples for 'query' (e.g., 'dropdown', 'navigation', 'layout'), giving meaningful context beyond the schema's basic type definition.

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?

Explicitly states it searches the official Flet documentation index for a specific topic/control. Distinguishes itself from sibling 'get_flet_doc' by indicating its role as the initial search step.

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?

Provides explicit guidance: 'Always use this first to find the correct file path before calling get_flet_doc.' Clearly defines workflow and when to use this tool versus the alternative.

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