Skip to main content
Glama

fal-cancel

Cancel a specific AI generation request using its request ID and model ID to stop processing.

Instructions

Cancel a the given request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
modelIdYes

Implementation Reference

  • Registration of the 'fal-cancel' tool on the McpServer with schema {requestId: string, modelId: string} and handler that calls client.cancel()
    server.tool(
        'fal-cancel',
        'Cancel a the given request',
        { requestId: z.string(), modelId: z.string() },
        async ({ requestId, modelId }) => {
            const output = await client.cancel(requestId, modelId);
            return { content: [{ type: 'text', text: toText(output) }] };
        },
    );
  • Handler function for fal-cancel: receives requestId and modelId, calls client.cancel(requestId, modelId), returns text content
    async ({ requestId, modelId }) => {
        const output = await client.cancel(requestId, modelId);
        return { content: [{ type: 'text', text: toText(output) }] };
    },
  • Input schema for fal-cancel: requestId (string) and modelId (string), validated with zod
    { requestId: z.string(), modelId: z.string() },
  • FalClient.cancel() method: constructs URL using QUEUE_BASE, sends PUT request with API key auth, handles errors and parses response
    async cancel(requestId: string, modelId: string): Promise<unknown> {
        const baseModel = this._baseModelId(this._normalizeModelId(modelId));
        const url = `${this.QUEUE_BASE}/${baseModel}/requests/${encodeURIComponent(requestId)}/cancel`;
        const res = await request(url, {
            method: 'PUT',
            headers: {
                Authorization: `Key ${this._apiKey}`,
            },
        });
        if (res.statusCode && res.statusCode >= 400) {
            await this._throwForStatus(res.statusCode, url, await res.body.text());
        }
        return await this._safeParse(await res.body.text());
    }
Behavior1/5

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

No annotations provided, so the description carries full burden. It does not disclose what happens on cancel (e.g., side effects, if request can be canceled after completion, or permission requirements). The behavior is entirely opaque beyond the action name.

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

Conciseness2/5

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

Very short but ungrammatical ('a the'). While brevity is valued, this description lacks clarity and proper structure, making it less effective.

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

Completeness1/5

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

Given no output schema, no annotations, and minimal parameter info, the description is severely incomplete. It does not explain return values, error states, or lifecycle implications of cancelation.

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

Parameters1/5

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

Schema has 2 parameters (requestId, modelId) with 0% description coverage. The description adds no meaning for these parameters, failing to explain their roles or expected values.

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

Purpose3/5

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

The description states the verb 'cancel' and the resource 'request', which aligns with the tool name. However, the phrasing 'a the given request' is grammatically poor and vague, not specifying what type of request (e.g., queued inference). It distinguishes from siblings like fal-enqueue and fal-get-status by implying a cancellation action, but lacks precision.

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. Siblings include fal-enqueue (create), fal-get-status (check status), and fal-get-result (fetch results), but the description does not mention these or provide context for cancelation scenarios.

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