import { z } from '@frontmcp/lazy-zod'; import { type AuthInfo } from '@frontmcp/protocol'; import { type ToolResponseContent } from '@frontmcp/uipack/adapters'; import { FlowBase, ToolContext, ToolEntry, type FlowRunOptions } from '../../common'; declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{ request: import("@frontmcp/lazy-zod").ZodObject<{ method: import("@frontmcp/lazy-zod").ZodLiteral<"tools/call">; params: import("@frontmcp/lazy-zod").ZodObject<{ _meta: import("@frontmcp/lazy-zod").ZodOptional>; "io.modelcontextprotocol/related-task": import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$loose>>; task: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; name: import("@frontmcp/lazy-zod").ZodString; arguments: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>; }, import("zod/v4/core").$strip>; ctx: import("@frontmcp/lazy-zod").ZodAny; }, import("zod/v4/core").$strip>; declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{ _meta: import("@frontmcp/lazy-zod").ZodOptional>; "io.modelcontextprotocol/related-task": import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$loose>>; content: import("@frontmcp/lazy-zod").ZodDefault; text: import("@frontmcp/lazy-zod").ZodString; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ type: import("@frontmcp/lazy-zod").ZodLiteral<"image">; data: import("@frontmcp/lazy-zod").ZodString; mimeType: import("@frontmcp/lazy-zod").ZodString; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ type: import("@frontmcp/lazy-zod").ZodLiteral<"audio">; data: import("@frontmcp/lazy-zod").ZodString; mimeType: import("@frontmcp/lazy-zod").ZodString; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ uri: import("@frontmcp/lazy-zod").ZodString; description: import("@frontmcp/lazy-zod").ZodOptional; mimeType: import("@frontmcp/lazy-zod").ZodOptional; size: import("@frontmcp/lazy-zod").ZodOptional; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; icons: import("@frontmcp/lazy-zod").ZodOptional; sizes: import("@frontmcp/lazy-zod").ZodOptional>; theme: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>>>; name: import("@frontmcp/lazy-zod").ZodString; title: import("@frontmcp/lazy-zod").ZodOptional; type: import("@frontmcp/lazy-zod").ZodLiteral<"resource_link">; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ type: import("@frontmcp/lazy-zod").ZodLiteral<"resource">; resource: import("@frontmcp/lazy-zod").ZodUnion; _meta: import("@frontmcp/lazy-zod").ZodOptional>; text: import("@frontmcp/lazy-zod").ZodString; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ uri: import("@frontmcp/lazy-zod").ZodString; mimeType: import("@frontmcp/lazy-zod").ZodOptional; _meta: import("@frontmcp/lazy-zod").ZodOptional>; blob: import("@frontmcp/lazy-zod").ZodString; }, import("zod/v4/core").$strip>]>; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>]>>>; structuredContent: import("@frontmcp/lazy-zod").ZodOptional>; isError: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$loose>; declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{ input: import("@frontmcp/lazy-zod").ZodObject<{ name: import("@frontmcp/lazy-zod").ZodString; arguments: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$loose>; authInfo: z.ZodType; tool: import("zod").ZodCustom>; }>, import("../../common").ToolOutputType, unknown, unknown>, ToolEntry>; }>, import("../../common").ToolOutputType, unknown, unknown>>; toolContext: import("zod").ZodCustom>; }>, import("../../common").ToolOutputType, unknown, unknown>, ToolContext>; }>, import("../../common").ToolOutputType, unknown, unknown>>; rawOutput: import("@frontmcp/lazy-zod").ZodOptional; output: import("@frontmcp/lazy-zod").ZodObject<{ _meta: import("@frontmcp/lazy-zod").ZodOptional>; "io.modelcontextprotocol/related-task": import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$loose>>; content: import("@frontmcp/lazy-zod").ZodDefault; text: import("@frontmcp/lazy-zod").ZodString; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ type: import("@frontmcp/lazy-zod").ZodLiteral<"image">; data: import("@frontmcp/lazy-zod").ZodString; mimeType: import("@frontmcp/lazy-zod").ZodString; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ type: import("@frontmcp/lazy-zod").ZodLiteral<"audio">; data: import("@frontmcp/lazy-zod").ZodString; mimeType: import("@frontmcp/lazy-zod").ZodString; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ uri: import("@frontmcp/lazy-zod").ZodString; description: import("@frontmcp/lazy-zod").ZodOptional; mimeType: import("@frontmcp/lazy-zod").ZodOptional; size: import("@frontmcp/lazy-zod").ZodOptional; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; icons: import("@frontmcp/lazy-zod").ZodOptional; sizes: import("@frontmcp/lazy-zod").ZodOptional>; theme: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>>>; name: import("@frontmcp/lazy-zod").ZodString; title: import("@frontmcp/lazy-zod").ZodOptional; type: import("@frontmcp/lazy-zod").ZodLiteral<"resource_link">; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ type: import("@frontmcp/lazy-zod").ZodLiteral<"resource">; resource: import("@frontmcp/lazy-zod").ZodUnion; _meta: import("@frontmcp/lazy-zod").ZodOptional>; text: import("@frontmcp/lazy-zod").ZodString; }, import("zod/v4/core").$strip>, import("@frontmcp/lazy-zod").ZodObject<{ uri: import("@frontmcp/lazy-zod").ZodString; mimeType: import("@frontmcp/lazy-zod").ZodOptional; _meta: import("@frontmcp/lazy-zod").ZodOptional>; blob: import("@frontmcp/lazy-zod").ZodString; }, import("zod/v4/core").$strip>]>; annotations: import("@frontmcp/lazy-zod").ZodOptional>>; priority: import("@frontmcp/lazy-zod").ZodOptional; lastModified: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$strip>>; _meta: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$strip>]>>>; structuredContent: import("@frontmcp/lazy-zod").ZodOptional>; isError: import("@frontmcp/lazy-zod").ZodOptional; }, import("zod/v4/core").$loose>; _toolOwnerId: import("@frontmcp/lazy-zod").ZodOptional; uiResult: z.ZodType; uiMeta: import("@frontmcp/lazy-zod").ZodOptional>; progressToken: import("@frontmcp/lazy-zod").ZodOptional>; jsonRpcRequestId: import("@frontmcp/lazy-zod").ZodOptional>; semaphoreTicket: import("@frontmcp/lazy-zod").ZodOptional; taskRequest: import("@frontmcp/lazy-zod").ZodOptional>; }, import("zod/v4/core").$loose>>; }, import("zod/v4/core").$strip>; declare const plan: { readonly pre: ["parseInput", "ensureRemoteCapabilities", "findTool", "checkToolAuthorization", "checkEntryAuthorities", "createTaskIfRequested", "createToolCallContext", "checkToolCredentials", "acquireQuota", "acquireSemaphore"]; readonly execute: ["validateInput", "execute", "validateOutput"]; readonly finalize: ["releaseSemaphore", "releaseQuota", "applyUI", "finalize"]; }; declare global { interface ExtendFlows { 'tools:call-tool': FlowRunOptions; } } declare const name: "tools:call-tool"; export default class CallToolFlow extends FlowBase { logger: import("../../common").FrontMcpLogger; parseInput(): Promise; /** * Ensure remote app capabilities are loaded before looking up tools. * Remote apps use lazy capability discovery - this triggers the loading. * Uses provider registry to find all remote apps across all app registries. */ ensureRemoteCapabilities(): Promise; findTool(): Promise; /** * MCP 2025-11-25 tasks spec: handle `params.task` on `tools/call`. * * Enforces the tool-level `execution.taskSupport` contract: * - `'required'` + no `task` → -32601 (TaskAugmentationRequiredError) * - (absent | `'forbidden'`) + `task` → -32601 (TaskAugmentationNotSupportedError) * - otherwise pass through: task path creates a record and responds with * `CreateTaskResult`, non-task path continues the existing flow. */ createTaskIfRequested(): Promise; /** * Check if the tool's parent app is authorized. * For progressive authorization, tools from unauthorized apps * return an AuthorizationRequiredError with an auth_url. */ checkToolAuthorization(): Promise; /** * Build the URL for progressive/incremental authorization */ private buildProgressiveAuthUrl; /** * Check entry-level authorities (RBAC/ABAC/ReBAC) declared in tool metadata. * Hookable: developers can use Will/Did/Around on 'checkEntryAuthorities'. * Skips silently if no authorities engine is configured or no authorities on the tool. */ checkEntryAuthorities(): Promise; createToolCallContext(): Promise; /** * TOOL-LEVEL credential gate. * * Reads the tool's `authProviders` and, for every provider declared * `required: true` (the default per the metadata), verifies a credential is * available for the current session BEFORE `execute()` runs. A missing * required credential aborts the call with {@link ToolCredentialsRequiredError} * (JSON-RPC -32001 / MCP UNAUTHORIZED) carrying the provider id(s) and a * connect/authorize `authUrl`. * * Runs after `createToolCallContext` so the CONTEXT-scoped credential * accessors (`this.authProviders` / `this.credentials`) are resolvable via the * built tool context, and before `acquireQuota`/`acquireSemaphore`/`execute`. * * Behavior is intentionally a no-op — preserving the pre-existing call-tool * path exactly — when: * - the tool declares no `authProviders`, or * - all declared providers are `required: false`, or * - NO credential accessor is configured in the running scope (public mode, * no auth, vault disabled), or * - the call is trusted internal dispatch / a background task re-dispatch. * * Hookable: developers may use Will/Did/Around on 'checkToolCredentials'. */ checkToolCredentials(): Promise; acquireQuota(): Promise; acquireSemaphore(): Promise; validateInput(): Promise; execute(): Promise; validateOutput(): Promise; releaseSemaphore(): Promise; releaseQuota(): Promise; /** * Apply UI rendering to the tool response. * This stage handles all UI-related logic including platform detection, * serving mode resolution, and content formatting. */ applyUI(): Promise; /** * Finalize the tool response. * Validates output, applies UI result from applyUI stage, and sends the response. * * Note: This stage runs even when execute fails (as part of cleanup). * If rawOutput is undefined, it means an error occurred during execution * and the error will be propagated by the flow framework - we should not * throw a new error here. */ finalize(): Promise; } export {}; //# sourceMappingURL=call-tool.flow.d.ts.map