import type { CallToolResult, InputRequiredResult, ServerContext } from "@modelcontextprotocol/server"; import type { ActionEntry } from "../agent/production-agent.js"; import { type MCPCallerIdentity, type MCPConfig, type MCPRequestMeta } from "./build-server.js"; import { type McpActionApprovalState, type McpActionCallContext, type McpApprovalReview } from "./execute-action-call.js"; /** * The direct `tools/call` adapter's action branch, and the only caller of * `runMcpActionCallUnredacted`. It turns the raw outcome into the wire result * MCP clients have always received, inside this module, so what it exports * runs an action call and returns that wire result: never a raw result, and * never the unredacted call itself. `guard:mcp-unredacted-call-boundary` * holds this module to that export and build-server.ts to being its only * importer. */ /** The per-request server state the action branch reads. */ export interface DirectActionCallScope { config: MCPConfig; actions: Record; advertisedActions: Record; /** False for an action whose input schema the request leaves out. */ isAdvertisable: (name: string) => boolean; visibleActions: Record; fullCatalogRequested: boolean; directoryCatalog: boolean; requestMeta: MCPRequestMeta | undefined; effectiveIdentity: MCPCallerIdentity | undefined; actionCallContext: McpActionCallContext; acceptedContent: (typeof import("@modelcontextprotocol/server"))["acceptedContent"]; inputResponse: (typeof import("@modelcontextprotocol/server"))["inputResponse"]; requestMcpActionApproval: (approvalState: McpActionApprovalState, review: McpApprovalReview, ctx: ServerContext) => Promise; } /** The analytics record of a call that failed. */ export interface DirectActionCallFailure { errorType: string; errorMessage: string; } export declare function createDirectActionCall(scope: DirectActionCallScope): (call: { name: string; args: any; request: any; ctx: ServerContext; }, fail: (failure: DirectActionCallFailure) => void) => Promise | undefined; _meta?: Record | undefined; } | { content: { type: "text"; text: string; }[]; isError?: boolean | undefined; _meta?: { [k: string]: unknown; } | undefined; }>;