get_collection_details
Retrieve detailed information about a specific collection using its slug to access metadata and contents.
Instructions
Get detailed information about a specific collection.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_slug | Yes |
Implementation Reference
- The main handler function that executes the tool: fetches collection details from Replicate API using ReplicateClient and returns a parsed Collection object.async def get_collection_details(collection_slug: str) -> Collection: """Get detailed information about a specific collection.""" async with ReplicateClient(api_token=os.getenv("REPLICATE_API_TOKEN")) as client: result = await client.get_collection(collection_slug) return Collection(**result)
- src/mcp_server_replicate/server.py:667-667 (registration)Registers the get_collection_details tool on the FastMCP server instance using the @mcp.tool() decorator.@mcp.tool()
- Pydantic BaseModel used for input/output typing and validation of the Collection object returned by the tool.class Collection(BaseModel): """A collection of related models on Replicate.""" name: str = Field(..., description="Name of the collection") slug: str = Field(..., description="URL-friendly identifier for the collection") description: Optional[str] = Field(None, description="Description of the collection's purpose") models: List[Model] = Field(default_factory=list, description="Models in this collection")