/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { agentRunsDecideAgentRunMcpApproval } from "../../funcs/agentRunsDecideAgentRunMcpApproval.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.DecideAgentRunMcpApprovalRequest$inboundSchema, }; export const tool$agentRunsDecideAgentRunMcpApproval: ToolDefinition< typeof args > = { name: "agent-runs-decide-agent-run-mcp-approval", description: `Approve or deny a pending MCP tool call Creates a continuation run for an mcp_approval_request emitted by the source run. The gateway binds the single-use decision to the original server, tool, and arguments; denying never invokes the remote MCP tool.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await agentRunsDecideAgentRunMcpApproval( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };