Skip to main content
Glama
xujfcn
by xujfcn

list_models

Discover available AI models on Crazyrouter by filtering categories like chat, image, video, audio, or music to find the right model for your task.

Instructions

List available AI models on Crazyrouter. Filter by category: chat, image, video, audio, or music.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter models by category. Options: chat, image, video, audio, music. Omit to show all categories.

Implementation Reference

  • The registration and handler implementation for the `list_models` tool.
    // --- Tool: list_models ---
    server.tool(
      "list_models",
      "List available AI models on Crazyrouter. Filter by category: chat, image, video, audio, or music.",
      {
        category: z
          .enum(["chat", "image", "video", "audio", "music"])
          .optional()
          .describe("Filter models by category. Options: chat, image, video, audio, music. Omit to show all categories."),
      },
      async ({ category }) => {
        try {
          let liveModels: string[] = [];
          try {
            const result = (await apiRequest("/models")) as { data?: Array<{ id: string; owned_by?: string }> };
            if (result.data) liveModels = result.data.map((m) => m.id);
          } catch { /* fall back to local list */ }
    
          let output = "";
          if (category) {
            const models = MODEL_CATEGORIES[category] ?? [];
            output = `## ${category.charAt(0).toUpperCase() + category.slice(1)} Models\n\n`;
            output += models.map((m) => `- ${m}`).join("\n");
            output += `\n\nTotal: ${models.length} models listed (${liveModels.length > 0 ? liveModels.length + " total available via API" : "627+ total available"})`;
          } else {
            output = "## Available Model Categories\n\n";
            for (const [cat, models] of Object.entries(MODEL_CATEGORIES)) {
              const emoji = cat === "chat" ? "πŸ’¬" : cat === "image" ? "🎨" : cat === "video" ? "🎬" : cat === "audio" ? "πŸ—£οΈ" : "🎡";
              output += `### ${emoji} ${cat.charAt(0).toUpperCase() + cat.slice(1)} (${models.length} listed)\n`;
              output += models.map((m) => `- ${m}`).join("\n");
              output += "\n\n";
            }
            output += `---\nπŸ“Š Total: 627+ models available on Crazyrouter\nπŸ”— Full list: https://crazyrouter.com/models`;
          }
    
          return { content: [{ type: "text" as const, text: output }] };
        } catch (error) {
          const message = error instanceof Error ? error.message : "Unknown error occurred";
          return { content: [{ type: "text" as const, text: `Error: ${message}` }], isError: true };
        }
      }
    );
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/xujfcn/crazyrouter-mcp'

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