Skip to main content
Glama

fal-get-model-schema

Retrieve the input and output schema of any model by providing its modelId. Use this to understand the model's data structure and requirements for making valid requests.

Instructions

Get the schema for a model. The model schema is used to understand the input and output of the model. use the modelId to get the schema of the model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelIdYes

Implementation Reference

  • The tool handler for 'fal-get-model-schema'. Registers the tool with server.tool(), takes a modelId parameter, calls client.getModelSchema(), and returns the schema as text content.
    server.tool(
        'fal-get-model-schema',
        'Get the schema for a model. The model schema is used to understand the input and output of the model. use the modelId to get the schema of the model.',
        {
            modelId: z.string(),
        },
        async (args) => {
            const modelId = (args as any)?.modelId ?? (args as any)?.arguments?.modelId;
            const schema = await client.getModelSchema(modelId as any);
            return { content: [{ type: 'text', text: toText(schema) }] };
        },
    );
  • The getModelSchema() method in FalClient that fetches the OpenAPI schema for a model from the fal.ai API endpoint.
    async getModelSchema(modelId: string): Promise<unknown> {
        if (!modelId) {
            return { error: 'modelId is required' };
        }
        const endpointId = this._normalizeModelId(modelId);
        const url = `${this.BASE_URL}/openapi/queue/openapi.json?endpoint_id=${encodeURIComponent(endpointId)}`;
        return await this._getJson(url);
    }
  • The input schema for the tool, defined inline with zod: takes a single required 'modelId' string parameter.
    server.tool(
        'fal-get-model-schema',
        'Get the schema for a model. The model schema is used to understand the input and output of the model. use the modelId to get the schema of the model.',
        {
            modelId: z.string(),
        },
  • src/tools/index.ts:6-6 (registration)
    The registerTools function exports the tool registration. Called from server/index.ts to register all tools including fal-get-model-schema.
    export function registerTools(server: McpServer, token: string): void {
Behavior1/5

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

No annotations provided; description does not disclose read-only nature, side effects, authentication needs, or rate limits. The statement is purely functional without behavioral context.

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?

Three sentences, but the second sentence is redundant (explains purpose of schema) and the third repeats the first. Could be two sentences without loss.

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?

With no output schema and simple input, the description should at least hint at the structure of the returned schema or how to interpret it. It only says 'schema' but no details.

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?

Schema coverage is 0% with no parameter descriptions; the description only repeats the parameter name 'modelId' and says 'use it to get the schema'. No additional meaning beyond the schema's type string.

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

Purpose5/5

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

The description clearly states the verb 'Get' and the resource 'schema for a model', which is distinct from sibling tools like fal-list-models. No confusion.

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 on when to use this tool versus alternatives like fal-list-models or fal-run-sync. No context about prerequisites or typical use cases.

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