list_templates
Browse available AI model templates and their schemas for image generation using the Replicate API.
Instructions
List all available templates with their schemas.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_templates"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The list_templates tool handler function that iterates over the TEMPLATES dictionary and returns a structured dictionary with each template's schema, description, and version.
def list_templates() -> dict[str, Any]: """List all available templates with their schemas.""" return { name: { "schema": template["parameter_schema"], "description": template.get("description", ""), "version": template.get("version", "1.0.0"), } for name, template in TEMPLATES.items() } - src/mcp_server_replicate/server.py:684-694 (registration)The @mcp.tool() decorator registers the list_templates function as an MCP tool on the FastMCP server instance.
def list_templates() -> dict[str, Any]: """List all available templates with their schemas.""" return { name: { "schema": template["parameter_schema"], "description": template.get("description", ""), "version": template.get("version", "1.0.0"), } for name, template in TEMPLATES.items() } - Definition of the TEMPLATES dictionary used by list_templates, aggregating various preset configurations.
TEMPLATES: dict[str, dict[str, Any]] = { "quality": QUALITY_PRESETS, "style": STYLE_PRESETS, "aspect_ratio": ASPECT_RATIO_PRESETS, "negative_prompt": NEGATIVE_PROMPT_PRESETS, }