Skip to main content
Glama

get_flet_doc

Fetch complete Markdown documentation for any Flet control or topic using its exact file path. Get detailed reference material directly from the official docs.

Instructions

Fetch the full Markdown documentation for a specific Flet control or topic.

Args: doc_path: The exact path to the doc file, usually obtained from search_flet_docs (e.g., 'website/docs/controls/dropdown/index.md').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async handler function for the 'get_flet_doc' MCP tool. Decorated with @mcp.tool(), it fetches full Markdown documentation for a Flet control by delegating to docs_fetcher.get_doc_content().
    @mcp.tool()
    async def get_flet_doc(doc_path: str) -> str:
        """
        Fetch the full Markdown documentation for a specific Flet control or topic.
        
        Args:
            doc_path: The exact path to the doc file, usually obtained from search_flet_docs 
                      (e.g., 'website/docs/controls/dropdown/index.md').
        """
        return await docs_fetcher.get_doc_content(doc_path)
  • The helper method get_doc_content in FletDocsFetcher that does the actual work: constructs a raw.githubusercontent.com URL and fetches the Markdown content with caching.
    async def get_doc_content(self, file_path: str) -> str:
        """Fetches the raw Markdown content for a specific Flet doc file."""
        # Use raw.githubusercontent for fast, quota-free raw file fetching
        raw_url = f"https://raw.githubusercontent.com/flet-dev/flet/main/{file_path}"
        content = await self._fetch_text(raw_url)
    
        if content:
            return content
        return f"Error: Could not fetch documentation for {file_path}. Ensure the path is correct."
  • The tool is registered via the @mcp.tool() decorator on FastMCP instance 'mcp' in src/flet_mcp/server.py.
    @mcp.tool()
    async def get_flet_doc(doc_path: str) -> str:
  • The _fetch_text helper method that caches fetched Markdown content with a 24-hour TTL using diskcache.
    async def _fetch_text(self, url: str) -> str | None:
        """Helper to fetch and cache raw Markdown text (24-hour TTL)."""
        if url in cache:
            return cache[url]
    
        response = await self.client.get(url)
        if response.status_code == 200:
            text = response.text
            cache.set(url, text, expire=86400)
            return text
        return None
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses it fetches Markdown documentation, a read operation, but does not mention error handling or behavior for invalid paths.

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?

Extremely concise: one sentence for purpose and one for parameter description. No fluff, front-loaded with the action.

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 low complexity (one parameter) and existence of an output schema, the description covers all necessary information: what it does, required input, and where to get it.

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

Parameters5/5

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

With 0% schema coverage, the description fully compensates by explaining the doc_path parameter: its purpose, origin (from search_flet_docs), and provides an example.

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 fetches full Markdown documentation for a specific Flet control or topic, differentiating it from sibling tools like search_flet_docs which is for searching.

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?

Provides explicit guidance that doc_path is usually obtained from search_flet_docs, implying this tool is used after searching. Does not explicitly list alternative tools but the usage context is clear.

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