/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { agentConnectorsCreateAgentConnector } from "../../funcs/agentConnectorsCreateAgentConnector.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.CreateAgentConnectorRequest$inboundSchema, }; export const tool$agentConnectorsCreateAgentConnector: ToolDefinition< typeof args > = { name: "agent-connectors-create-agent-connector", description: `Create a connector Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. WhatsApp connector support is beta. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await agentConnectorsCreateAgentConnector( 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); }, };