Skip to main content
Glama
aserper

RTFD (Read The F*****g Docs)

by aserper

docker_image_metadata

Retrieve Docker image metadata including popularity metrics, description, and update status from DockerHub to verify image details before deployment.

Instructions

        Get detailed metadata for a specific Docker image from DockerHub.

        USE THIS WHEN: You need comprehensive information about a Docker image (stats, description, tags).

        RETURNS: Image metadata including popularity metrics and description.
        Does NOT include full README documentation.

        The response includes:
        - Image name, namespace, description
        - Star count (popularity)
        - Pull count (total downloads)
        - Last updated timestamp
        - Official/community status

        Args:
            image: Docker image name (e.g., "nginx", "postgres", "username/custom-image")

        Returns:
            JSON with comprehensive image metadata

        Example: docker_image_metadata("nginx") → Returns stars, pulls, description for nginx image
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYes

Implementation Reference

  • The main execution handler for the 'docker_image_metadata' tool. It invokes the private _fetch_image_metadata helper and serializes the result into a CallToolResult.
    async def docker_image_metadata(image: str) -> CallToolResult:
        """
        Get detailed metadata for a specific Docker image from DockerHub.
    
        USE THIS WHEN: You need comprehensive information about a Docker image (stats, description, tags).
    
        RETURNS: Image metadata including popularity metrics and description.
        Does NOT include full README documentation.
    
        The response includes:
        - Image name, namespace, description
        - Star count (popularity)
        - Pull count (total downloads)
        - Last updated timestamp
        - Official/community status
    
        Args:
            image: Docker image name (e.g., "nginx", "postgres", "username/custom-image")
    
        Returns:
            JSON with comprehensive image metadata
    
        Example: docker_image_metadata("nginx") → Returns stars, pulls, description for nginx image
        """
        result = await self._fetch_image_metadata(image)
        return serialize_response_with_meta(result)
  • Registration of the 'docker_image_metadata' tool handler in the dictionary returned by the get_tools() method, making it available as an MCP tool.
    tools = {
        "search_docker_images": search_docker_images,
        "docker_image_metadata": docker_image_metadata,
    }
  • Private helper method that performs the HTTP request to DockerHub API to retrieve detailed metadata for the specified image, handling library images and errors.
    async def _fetch_image_metadata(self, image: str) -> dict[str, Any]:
        """Fetch detailed metadata for a Docker image.
    
        Args:
            image: Image name (can be 'namespace/name' or just 'name' for library)
    
        Returns:
            Dict with image metadata
        """
        try:
            # Handle library images (e.g., 'nginx' -> 'library/nginx')
            if "/" not in image:
                repo_path = f"library/{image}"
            else:
                repo_path = image
    
            url = f"{self.DOCKERHUB_API_URL}/repositories/{repo_path}/"
    
            async with await self._http_client() as client:
                resp = await client.get(url)
                resp.raise_for_status()
                data = resp.json()
    
            return {
                "name": data.get("name"),
                "namespace": data.get("namespace"),
                "full_name": data.get("full_name", f"{data.get('namespace')}/{data.get('name')}"),
                "description": data.get("description", ""),
                "readme": data.get("readme", ""),  # Full readme text if available
                "last_updated": data.get("last_updated"),
                "star_count": data.get("star_count", 0),
                "pull_count": data.get("pull_count", 0),
                "is_official": data.get("is_official", False),
                "is_private": data.get("is_private", False),
                "repository_type": data.get("repository_type"),
                "url": f"https://hub.docker.com/r/{repo_path}",
            }
    
        except httpx.HTTPStatusError as exc:
            if exc.response.status_code == 404:
                return {
                    "image": image,
                    "error": "Image not found on DockerHub",
                }
            return {
                "image": image,
                "error": f"DockerHub returned {exc.response.status_code}",
            }
        except httpx.HTTPError as exc:
            return {
                "image": image,
                "error": f"DockerHub request failed: {exc}",
            }
        except Exception as exc:
            return {
                "image": image,
                "error": f"Failed to fetch metadata: {exc!s}",
            }
  • The tool name 'docker_image_metadata' is listed in the tool_names array returned by get_metadata(), exposing it in provider metadata.
    tool_names = ["search_docker_images", "docker_image_metadata"]
    if is_fetch_enabled():

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/aserper/RTFD'

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