Skip to main content
Glama

fal-search-models

Search for AI models by keyword, optionally filtering by category and limiting results. Find models that match your keywords quickly.

Instructions

Search for models by keywords with optional category and limit filtering. The keywords are used to search for models that match the keywords.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYes
limitNo
categoryNo

Implementation Reference

  • The tool handler/registration for 'fal-search-models'. Defines the tool with Zod schema (keyword required, limit and category optional) and the async handler that calls client.searchModels() and returns the result as text.
    server.tool(
        'fal-search-models',
        'Search for models by keywords with optional category and limit filtering. The keywords are used to search for models that match the keywords.',
        {
            keyword: z.string(),
            limit: z.number().optional(),
            category: z.string().optional(),
        },
        async ({ keyword, limit, category }) => {
            const result = (await client.searchModels({ keyword, limit, category })) as
                | { models?: FalModel[] }
                | FalModel[]
                | unknown;
            const list = Array.isArray(result) ? result : ((result as any)?.models ?? result);
            return { content: [{ type: 'text', text: toText(list) }] };
        },
    );
  • The tool registration via server.tool('fal-search-models', ...) on line 38. This is where the tool is registered with the MCP server.
    server.tool(
        'fal-search-models',
        'Search for models by keywords with optional category and limit filtering. The keywords are used to search for models that match the keywords.',
        {
            keyword: z.string(),
            limit: z.number().optional(),
            category: z.string().optional(),
        },
        async ({ keyword, limit, category }) => {
            const result = (await client.searchModels({ keyword, limit, category })) as
                | { models?: FalModel[] }
                | FalModel[]
                | unknown;
            const list = Array.isArray(result) ? result : ((result as any)?.models ?? result);
            return { content: [{ type: 'text', text: toText(list) }] };
        },
    );
  • The searchModels() method on FalClient that performs the HTTP GET request to https://fal.ai/api/models with query parameters (keywords, limit, category) and returns the parsed JSON result as {models: FalModel[]}.
    async searchModels(params: {
        keyword: string;
        limit?: number;
        category?: string;
    }): Promise<{ models: FalModel[] }> {
        const url = new URL(`${this.BASE_URL}/models`);
        url.searchParams.set('keywords', params.keyword);
        if (params.limit != null) url.searchParams.set('limit', String(params.limit));
        if (params.category != null) url.searchParams.set('category', params.category);
        return this._getJson(url.toString()) as Promise<{ models: FalModel[] }>;
    }
  • The FalModelSchema Zod schema and FalModel type used for the search results. Defines the structure of a model object returned by the search.
    import { z } from 'zod';
    
    export const FalModelSchema = z.object({
        id: z.string(),
        modelId: z.string(),
        isFavorited: z.boolean(),
        title: z.string(),
        category: z.string(),
        tags: z.array(z.string()),
        shortDescription: z.string(),
        thumbnailUrl: z.string(),
        modelUrl: z.string(),
        githubUrl: z.string(),
        licenseType: z.string(),
        date: z.string(),
        group: z.object({
            key: z.string(),
            label: z.string(),
        }),
        machineType: z.string().nullable(),
        examples: z.array(z.string()),
        highlighted: z.boolean(),
        authSkippable: z.boolean(),
        unlisted: z.boolean(),
        deprecated: z.boolean(),
        resultComparison: z.boolean(),
        hidePricing: z.boolean(),
        private: z.boolean(),
        removed: z.boolean(),
        adminOnly: z.boolean(),
        kind: z.string(),
        trainingEndpoints: z.array(z.unknown()),
    });
    
    export type FalModel = z.infer<typeof FalModelSchema>;
  • Example usage of fal-search-models tool in a test script, demonstrating how to search for 'image generation' and 'text' models with limit=5.
    console.log('\nšŸŽØ Image generation models:');
    console.log('='.repeat(50));
    const imageModels = await client.callTool({
        name: 'fal-search-models',
        arguments: {
            keyword: 'image generation',
            limit: 5,
        },
    });
    console.log('Image models:', JSON.stringify(imageModels.content, null, 2));
    
    // Example 3: Search for text models
    console.log('\nšŸ“ Text/Language models:');
    console.log('='.repeat(50));
    const textModels = await client.callTool({
        name: 'fal-search-models',
        arguments: {
            keyword: 'text',
            limit: 5,
        },
    });
    
    const textModelsText = ((textModels as any).content?.[0] as any)?.text as string | undefined;
    const textModelsList = textModelsText ? JSON.parse(textModelsText) : [];
    
    if (Array.isArray(textModelsList)) {
        textModelsList.forEach((model: any, index: number) => {
            console.log(`${index + 1}. ${model.title || model.modelId}`);
            console.log(`   ID: ${model.modelId}`);
            console.log(`   Category: ${model.category}`);
            console.log(`   Description: ${model.shortDescription}`);
            console.log('');
        });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description bears full responsibility for behavioral disclosure. It only describes a search (implied read operation) without mentioning any side effects, rate limits, or response characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, but the second sentence ('The keywords are used to search for models that match the keywords.') is redundant with the first and could be removed to improve conciseness. The structure is acceptable but not optimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description lacks details about output format, default limit, valid category values, or pagination. Given no output schema, more context is needed for an agent to fully understand the tool's behavior and results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description should compensate but only briefly mentions 'optional category and limit filtering' without explaining what values category accepts or what limit controls. The keyword parameter is obvious but not elaborated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search for models') and mentions the filtering options ('keywords with optional category and limit filtering'), distinguishing it from sibling tools like fal-list-models. However, it could be more specific about what constitutes a model search versus listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool vs alternatives such as fal-list-models or fal-get-model-schema. The description does not include 'when to use' or 'when not to use' instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/Forge-Systems-Hub/mcp-fal-ai-server'

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