Skip to main content
Glama

get_model_details

Retrieve detailed specifications and configuration data for AI models to verify compatibility and understand capabilities before deployment.

Instructions

Get detailed information about a specific model.

Args: model_id: Model identifier in format owner/name Returns: Detailed model information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYes

Implementation Reference

  • Registration of the 'get_model_details' tool using the @mcp.tool decorator, specifying the name and description.
    @mcp.tool( name="get_model_details", description="Get detailed information about a specific model.", )
  • The handler function implements the logic to retrieve detailed model information by parsing the model_id, querying the owner's models via ReplicateClient, falling back to search if not found, and returning a Model object or raising ValueError.
    async def get_model_details(model_id: str) -> Model: """Get detailed information about a specific model. Args: model_id: Model identifier in format 'owner/model' Returns: Model object containing detailed model information Raises: RuntimeError: If the Replicate client fails to initialize ValueError: If the model is not found Exception: If the API request fails """ owner, name = model_id.split("/") async with ReplicateClient() as client: # First try to find the model in the owner's models result = client.list_models(owner=owner) for model in result["models"]: if model["name"] == name: return Model(**model) # If not found, try searching for it search_result = await client.search_models(model_id) for model in search_result["models"]: if f"{model['owner']}/{model['name']}" == model_id: return Model(**model) raise ValueError(f"Model not found: {model_id}")

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