venice_list_models
List available Venice AI models by type to identify suitable options for text generation, image creation, speech synthesis, embeddings, and other AI tasks.
Instructions
List available Venice AI models by type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Filter by model type (text, image, embedding, tts, asr, upscale, inpaint, video, or all) | all |
Implementation Reference
- src/tools/discovery/index.ts:12-21 (handler)The main handler function for the 'venice_list_models' tool. It calls the Venice API with the provided type filter, parses the ModelsResponse, formats a list of models, and returns it as text content.async ({ type }) => { // Always pass type parameter - API may return only text models without it const endpoint = `/models?type=${type}`; const response = await veniceAPI(endpoint); const data = await response.json() as ModelsResponse; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; const models = data.data || []; const list = models.map((m) => `- ${m.id} (${m.type || m.object || "unknown"})`).join("\n"); return { content: [{ type: "text" as const, text: `Available models (${models.length}):\n${list}` }] }; }
- src/tools/discovery/index.ts:11-11 (schema)Zod input schema for the tool, defining an optional 'type' parameter to filter models.{ type: z.enum(["text", "image", "embedding", "tts", "asr", "upscale", "inpaint", "video", "all"]).optional().default("all").describe("Filter by model type (text, image, embedding, tts, asr, upscale, inpaint, video, or all)") },
- src/tools/discovery/index.ts:8-22 (registration)Registration of the 'venice_list_models' tool on the MCP server, specifying name, description, input schema, and handler function.server.tool( "venice_list_models", "List available Venice AI models by type", { type: z.enum(["text", "image", "embedding", "tts", "asr", "upscale", "inpaint", "video", "all"]).optional().default("all").describe("Filter by model type (text, image, embedding, tts, asr, upscale, inpaint, video, or all)") }, async ({ type }) => { // Always pass type parameter - API may return only text models without it const endpoint = `/models?type=${type}`; const response = await veniceAPI(endpoint); const data = await response.json() as ModelsResponse; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; const models = data.data || []; const list = models.map((m) => `- ${m.id} (${m.type || m.object || "unknown"})`).join("\n"); return { content: [{ type: "text" as const, text: `Available models (${models.length}):\n${list}` }] }; } );
- src/client/venice-api.ts:9-17 (helper)Helper function 'veniceAPI' used by the tool handler to perform authenticated HTTP requests to the Venice AI API.export async function veniceAPI(endpoint: string, options: RequestInit = {}): Promise<Response> { const url = `${BASE_URL}${endpoint}`; const headers: Record<string, string> = { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json", ...(options.headers as Record<string, string> || {}), }; return fetch(url, { ...options, headers }); }
- src/types/api-types.ts:45-47 (schema)TypeScript interface 'ModelsResponse' used to type the API response data in the handler.export interface ModelsResponse extends VeniceAPIError { data?: Model[]; }