Skip to main content
Glama

get_package_details

Retrieve PyPI details, current version, and installation instructions for a specified Flet package.

Instructions

Fetch PyPI details, current version, and installation instructions for a specific Flet package.

Args: package_name: The exact name of the package on PyPI (e.g., 'flet-audio').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
package_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler that delegates to FletPackageFetcher.get_package_details(). This is the @mcp.tool()-decorated function invoked when the 'get_package_details' tool is called.
    @mcp.tool()
    async def get_package_details(package_name: str) -> str:
        """
        Fetch PyPI details, current version, and installation instructions for a specific Flet package.
        
        Args:
            package_name: The exact name of the package on PyPI (e.g., 'flet-audio').
        """
        return await pkg_fetcher.get_package_details(package_name)
  • Core implementation: fetches PyPI JSON data for a package, extracts version/summary, classifies the package type (UI Control, Service Integration, or Python Package), and returns formatted details with installation instructions.
    async def get_package_details(self, package_name: str) -> str:
        """Fetches detailed package info and installation instructions from PyPI."""
        url = f"https://pypi.org/pypi/{package_name}/json"
        data = await self._fetch_json(url)
        
        if not data or "info" not in data:
            return f"Package '{package_name}' not found on PyPI."
    
        info = data["info"]
        version = info.get("version", "Unknown")
        summary = info.get("summary", "No summary available.")
        
        # Smart Classification
        pkg_type = "Python Package"
        summary_lower = summary.lower()
        if "control" in summary_lower or "widget" in summary_lower or "ui" in summary_lower:
            pkg_type = "UI Control"
        elif "service" in summary_lower or "auth" in summary_lower or "database" in summary_lower:
            pkg_type = "Service Integration"
    
        details = (
            f"Package: {package_name} (v{version})\n"
            f"Type: {pkg_type}\n"
            f"Summary: {summary}\n\n"
            f"Installation:\n```bash\n"
            f"uv add {package_name}\n```\n"
        )
        return details
  • The @mcp.tool() decorator on the get_package_details function registers it as an MCP tool in the FastMCP server instance named 'mcp'.
    @mcp.tool()
    async def get_package_details(package_name: str) -> str:
  • The tool's input schema is implicitly defined by the function signature (package_name: str). The docstring serves as the description for this parameter.
    async def get_package_details(package_name: str) -> str:
        """
        Fetch PyPI details, current version, and installation instructions for a specific Flet package.
        
        Args:
            package_name: The exact name of the package on PyPI (e.g., 'flet-audio').
        """
  • Helper method _fetch_json used by get_package_details to fetch and cache PyPI JSON responses with a 24-hour TTL.
    async def _fetch_json(self, url: str, headers: dict | None = None) -> dict | None:
        if url in cache:
            return cache[url]
        try:
            response = await self.client.get(url, headers=headers)
            if response.status_code == 200:
                data = response.json()
                cache.set(url, data, expire=86400)
                return data
        except Exception:
            pass
        return None
Behavior2/5

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

No annotations provided, so the description must carry the full burden. It indicates a read operation ('fetch') but does not disclose potential errors (e.g., package not found), rate limits, or any side effects. Minimal 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 extremely concise: one main sentence explaining the tool and one line for parameter description. Every word adds value; no redundancy or filler.

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?

Output schema is present, so return values are covered. However, missing details on error handling, prerequisites (e.g., network access), and no usage guidance. Complements schema adequately but not fully.

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 coverage is 0%, but the description adds meaning by specifying that the package_name must be 'the exact name' and provides an example ('flet-audio'). This clarifies parameter usage beyond the schema's 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?

The description uses specific verb 'Fetch' and clearly identifies the resource: 'PyPI details, current version, and installation instructions for a specific Flet package'. It distinguishes well from sibling tools which focus on docs or listing controls.

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 does not provide any guidance on when to use this tool versus alternatives like search_flet_ecosystem. It simply states what it does without context of when it is appropriate or conditions for use.

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