Skip to main content
Glama
gerred

MCP Server Replicate

list_hardware

Discover available hardware configurations for running AI models to select optimal resources for inference tasks.

Instructions

List available hardware options for running models.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the list_hardware tool. It creates a ReplicateClient context, calls list_hardware on the client, and converts the raw results into a typed HardwareList response.
    async def list_hardware() -> HardwareList:
        """List available hardware options for running models.
        
        Returns:
            HardwareList containing available hardware options
            
        Raises:
            RuntimeError: If the Replicate client fails to initialize
            Exception: If the API request fails
        """
        async with ReplicateClient() as client:
            result = await client.list_hardware()
            return HardwareList(hardware=[Hardware(**hw) for hw in result]) 
  • Registers the list_hardware tool with the FastMCP server using the @mcp.tool decorator.
    @mcp.tool(
        name="list_hardware",
        description="List available hardware options for running models.",
    )
  • Pydantic models defining the structure of individual Hardware options and the HardwareList response used by the tool.
    class Hardware(BaseModel):
        """A hardware option for running models on Replicate."""
        name: str = Field(..., description="Human-readable name of the hardware")
        sku: str = Field(..., description="SKU identifier for the hardware")
    
    class HardwareList(BaseModel):
        """Response format for listing hardware options."""
        hardware: List[Hardware] 
  • Helper method in ReplicateClient that performs the actual HTTP GET request to the Replicate API's /hardware endpoint and formats the response.
    async def list_hardware(self) -> list[dict[str, str]]:
        """Get list of available hardware options for running models.
        
        Returns:
            List of hardware options with name and SKU
            
        Raises:
            Exception: If the API request fails
        """
        if not self.client:
            raise RuntimeError("Client not initialized. Check error property for details.")
    
        try:
            response = await self.http_client.get("/hardware")
            response.raise_for_status()
            
            return [
                {
                    "name": hw["name"],
                    "sku": hw["sku"],
                }
                for hw in response.json()
            ]
    
        except httpx.HTTPError as err:
            logger.error(f"HTTP error getting hardware options: {str(err)}")
            raise Exception(f"Failed to get hardware options: {str(err)}") from err
        except Exception as err:
            logger.error(f"Failed to get hardware options: {str(err)}")
            raise Exception(f"Failed to get hardware options: {str(err)}") from err
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it 'lists' hardware options, implying a read-only operation, but doesn't disclose behavioral traits like whether it requires authentication, has rate limits, returns paginated results, or what format the output takes. This is a significant gap for a tool with zero annotation coverage.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple listing tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple purpose, the description is incomplete. It lacks details on output format, authentication needs, or usage context, which are essential for an AI agent to invoke it correctly. The simplicity of the tool doesn't excuse these gaps.

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 description coverage is 100%, so no parameter documentation is needed. The description doesn't add param info beyond the schema, but with no params, a baseline of 4 is appropriate as there's nothing to compensate for.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('available hardware options for running models'), providing specific purpose. However, it doesn't differentiate from sibling tools like 'list_collections' or 'list_models' beyond the hardware focus, missing explicit distinction.

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?

No guidance is provided on when to use this tool versus alternatives. The description implies it's for hardware options related to models, but there's no mention of prerequisites, when not to use it, or how it compares to siblings like 'search_available_models' or 'get_model_details'.

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/gerred/mcp-server-replicate'

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