@utcp/sdk
Version:
Universal Tool Calling Protocol (UTCP) client library for TypeScript
1,626 lines • 57.9 kB
TypeScript
import { z } from 'zod';
/**
* Provider types supported by UTCP
*/
export declare const ProviderTypeSchema: z.ZodEnum<["http", "sse", "http_stream", "cli", "websocket", "grpc", "graphql", "tcp", "udp", "webrtc", "mcp", "text"]>;
export type ProviderType = z.infer<typeof ProviderTypeSchema>;
/**
* Base Provider schema
*/
export declare const ProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
provider_type: z.ZodEnum<["http", "sse", "http_stream", "cli", "websocket", "grpc", "graphql", "tcp", "udp", "webrtc", "mcp", "text"]>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "http" | "sse" | "http_stream" | "cli" | "websocket" | "grpc" | "graphql" | "tcp" | "udp" | "webrtc" | "mcp" | "text";
}, {
provider_type: "http" | "sse" | "http_stream" | "cli" | "websocket" | "grpc" | "graphql" | "tcp" | "udp" | "webrtc" | "mcp" | "text";
name?: string | undefined;
}>;
export type Provider = z.infer<typeof ProviderSchema>;
/**
* HTTP Provider schema for RESTful HTTP/HTTPS API tools
*/
export declare const HttpProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"http">;
http_method: z.ZodDefault<z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH"]>>;
url: z.ZodString;
content_type: z.ZodDefault<z.ZodString>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
body_field: z.ZodDefault<z.ZodOptional<z.ZodString>>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "http";
http_method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
url: string;
content_type: string;
body_field: string;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
}, {
provider_type: "http";
url: string;
name?: string | undefined;
http_method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | undefined;
content_type?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
}>;
export type HttpProvider = z.infer<typeof HttpProviderSchema>;
/**
* SSE Provider schema for Server-Sent Events tools
*/
export declare const SSEProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"sse">;
url: z.ZodString;
event_type: z.ZodOptional<z.ZodString>;
reconnect: z.ZodDefault<z.ZodBoolean>;
retry_timeout: z.ZodDefault<z.ZodNumber>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
body_field: z.ZodOptional<z.ZodString>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "sse";
url: string;
reconnect: boolean;
retry_timeout: number;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
event_type?: string | undefined;
}, {
provider_type: "sse";
url: string;
name?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
event_type?: string | undefined;
reconnect?: boolean | undefined;
retry_timeout?: number | undefined;
}>;
export type SSEProvider = z.infer<typeof SSEProviderSchema>;
/**
* HTTP Streaming Provider schema for HTTP Chunked Transfer Encoding tools
*/
export declare const StreamableHttpProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"http_stream">;
url: z.ZodString;
http_method: z.ZodDefault<z.ZodEnum<["GET", "POST"]>>;
content_type: z.ZodDefault<z.ZodString>;
chunk_size: z.ZodDefault<z.ZodNumber>;
timeout: z.ZodDefault<z.ZodNumber>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
body_field: z.ZodOptional<z.ZodString>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "http_stream";
http_method: "GET" | "POST";
url: string;
content_type: string;
chunk_size: number;
timeout: number;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
}, {
provider_type: "http_stream";
url: string;
name?: string | undefined;
http_method?: "GET" | "POST" | undefined;
content_type?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
chunk_size?: number | undefined;
timeout?: number | undefined;
}>;
export type StreamableHttpProvider = z.infer<typeof StreamableHttpProviderSchema>;
/**
* CLI Provider schema for Command Line Interface tools
*/
export declare const CliProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"cli">;
command_name: z.ZodString;
env_vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
working_dir: z.ZodOptional<z.ZodString>;
auth: z.ZodNull;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "cli";
auth: null;
command_name: string;
env_vars?: Record<string, string> | undefined;
working_dir?: string | undefined;
}, {
provider_type: "cli";
auth: null;
command_name: string;
name?: string | undefined;
env_vars?: Record<string, string> | undefined;
working_dir?: string | undefined;
}>;
export type CliProvider = z.infer<typeof CliProviderSchema>;
/**
* WebSocket Provider schema for WebSocket tools
*/
export declare const WebSocketProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"websocket">;
url: z.ZodString;
protocol: z.ZodOptional<z.ZodString>;
keep_alive: z.ZodDefault<z.ZodBoolean>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "websocket";
url: string;
keep_alive: boolean;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
protocol?: string | undefined;
}, {
provider_type: "websocket";
url: string;
name?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
protocol?: string | undefined;
keep_alive?: boolean | undefined;
}>;
export type WebSocketProvider = z.infer<typeof WebSocketProviderSchema>;
/**
* gRPC Provider schema for gRPC tools
*/
export declare const GRPCProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"grpc">;
host: z.ZodString;
port: z.ZodNumber;
service_name: z.ZodString;
method_name: z.ZodString;
use_ssl: z.ZodDefault<z.ZodBoolean>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "grpc";
host: string;
port: number;
service_name: string;
method_name: string;
use_ssl: boolean;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
}, {
provider_type: "grpc";
host: string;
port: number;
service_name: string;
method_name: string;
name?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
use_ssl?: boolean | undefined;
}>;
export type GRPCProvider = z.infer<typeof GRPCProviderSchema>;
/**
* GraphQL Provider schema for GraphQL tools
*/
export declare const GraphQLProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"graphql">;
url: z.ZodString;
operation_type: z.ZodDefault<z.ZodEnum<["query", "mutation", "subscription"]>>;
operation_name: z.ZodOptional<z.ZodString>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "graphql";
url: string;
operation_type: "query" | "mutation" | "subscription";
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
operation_name?: string | undefined;
}, {
provider_type: "graphql";
url: string;
name?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
operation_type?: "query" | "mutation" | "subscription" | undefined;
operation_name?: string | undefined;
}>;
export type GraphQLProvider = z.infer<typeof GraphQLProviderSchema>;
/**
* TCP Provider schema for raw TCP socket tools
*/
export declare const TCPProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"tcp">;
host: z.ZodString;
port: z.ZodNumber;
timeout: z.ZodDefault<z.ZodNumber>;
auth: z.ZodNull;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "tcp";
auth: null;
timeout: number;
host: string;
port: number;
}, {
provider_type: "tcp";
auth: null;
host: string;
port: number;
name?: string | undefined;
timeout?: number | undefined;
}>;
export type TCPProvider = z.infer<typeof TCPProviderSchema>;
/**
* UDP Provider schema for UDP socket tools
*/
export declare const UDPProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"udp">;
host: z.ZodString;
port: z.ZodNumber;
timeout: z.ZodDefault<z.ZodNumber>;
auth: z.ZodNull;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "udp";
auth: null;
timeout: number;
host: string;
port: number;
}, {
provider_type: "udp";
auth: null;
host: string;
port: number;
name?: string | undefined;
timeout?: number | undefined;
}>;
export type UDPProvider = z.infer<typeof UDPProviderSchema>;
/**
* WebRTC Provider schema for Web Real-Time Communication tools
*/
export declare const WebRTCProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"webrtc">;
signaling_server: z.ZodString;
peer_id: z.ZodString;
data_channel_name: z.ZodDefault<z.ZodString>;
auth: z.ZodNull;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "webrtc";
auth: null;
signaling_server: string;
peer_id: string;
data_channel_name: string;
}, {
provider_type: "webrtc";
auth: null;
signaling_server: string;
peer_id: string;
name?: string | undefined;
data_channel_name?: string | undefined;
}>;
export type WebRTCProvider = z.infer<typeof WebRTCProviderSchema>;
/**
* MCP Stdio Server schema for MCP servers connected via stdio
*/
export declare const McpStdioServerSchema: z.ZodObject<{
transport: z.ZodLiteral<"stdio">;
command: z.ZodString;
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
}, "strip", z.ZodTypeAny, {
transport: "stdio";
command: string;
args: string[];
env: Record<string, string>;
}, {
transport: "stdio";
command: string;
args?: string[] | undefined;
env?: Record<string, string> | undefined;
}>;
export type McpStdioServer = z.infer<typeof McpStdioServerSchema>;
/**
* MCP HTTP Server schema for MCP servers connected via streamable HTTP
*/
export declare const McpHttpServerSchema: z.ZodObject<{
transport: z.ZodLiteral<"http">;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
transport: "http";
}, {
url: string;
transport: "http";
}>;
export type McpHttpServer = z.infer<typeof McpHttpServerSchema>;
/**
* Combined MCP Server types
*/
export declare const McpServerSchema: z.ZodDiscriminatedUnion<"transport", [z.ZodObject<{
transport: z.ZodLiteral<"stdio">;
command: z.ZodString;
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
}, "strip", z.ZodTypeAny, {
transport: "stdio";
command: string;
args: string[];
env: Record<string, string>;
}, {
transport: "stdio";
command: string;
args?: string[] | undefined;
env?: Record<string, string> | undefined;
}>, z.ZodObject<{
transport: z.ZodLiteral<"http">;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
transport: "http";
}, {
url: string;
transport: "http";
}>]>;
export type McpServer = z.infer<typeof McpServerSchema>;
/**
* MCP Configuration schema
*/
export declare const McpConfigSchema: z.ZodObject<{
mcpServers: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"transport", [z.ZodObject<{
transport: z.ZodLiteral<"stdio">;
command: z.ZodString;
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
}, "strip", z.ZodTypeAny, {
transport: "stdio";
command: string;
args: string[];
env: Record<string, string>;
}, {
transport: "stdio";
command: string;
args?: string[] | undefined;
env?: Record<string, string> | undefined;
}>, z.ZodObject<{
transport: z.ZodLiteral<"http">;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
transport: "http";
}, {
url: string;
transport: "http";
}>]>>;
}, "strip", z.ZodTypeAny, {
mcpServers: Record<string, {
transport: "stdio";
command: string;
args: string[];
env: Record<string, string>;
} | {
url: string;
transport: "http";
}>;
}, {
mcpServers: Record<string, {
transport: "stdio";
command: string;
args?: string[] | undefined;
env?: Record<string, string> | undefined;
} | {
url: string;
transport: "http";
}>;
}>;
export type McpConfig = z.infer<typeof McpConfigSchema>;
/**
* MCP Provider schema for Model Context Protocol tools
*/
export declare const MCPProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"mcp">;
config: z.ZodObject<{
mcpServers: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"transport", [z.ZodObject<{
transport: z.ZodLiteral<"stdio">;
command: z.ZodString;
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
}, "strip", z.ZodTypeAny, {
transport: "stdio";
command: string;
args: string[];
env: Record<string, string>;
}, {
transport: "stdio";
command: string;
args?: string[] | undefined;
env?: Record<string, string> | undefined;
}>, z.ZodObject<{
transport: z.ZodLiteral<"http">;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
transport: "http";
}, {
url: string;
transport: "http";
}>]>>;
}, "strip", z.ZodTypeAny, {
mcpServers: Record<string, {
transport: "stdio";
command: string;
args: string[];
env: Record<string, string>;
} | {
url: string;
transport: "http";
}>;
}, {
mcpServers: Record<string, {
transport: "stdio";
command: string;
args?: string[] | undefined;
env?: Record<string, string> | undefined;
} | {
url: string;
transport: "http";
}>;
}>;
auth: z.ZodOptional<z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "mcp";
config: {
mcpServers: Record<string, {
transport: "stdio";
command: string;
args: string[];
env: Record<string, string>;
} | {
url: string;
transport: "http";
}>;
};
auth?: {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
}, {
provider_type: "mcp";
config: {
mcpServers: Record<string, {
transport: "stdio";
command: string;
args?: string[] | undefined;
env?: Record<string, string> | undefined;
} | {
url: string;
transport: "http";
}>;
};
name?: string | undefined;
auth?: {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
}>;
export type MCPProvider = z.infer<typeof MCPProviderSchema>;
/**
* Text Provider schema for text file-based tools
*/
export declare const TextProviderSchema: z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"text">;
file_path: z.ZodString;
auth: z.ZodDefault<z.ZodOptional<z.ZodNull>>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "text";
auth: null;
file_path: string;
}, {
provider_type: "text";
file_path: string;
name?: string | undefined;
auth?: null | undefined;
}>;
export type TextProvider = z.infer<typeof TextProviderSchema>;
/**
* Combined Provider schema using discriminated union based on provider_type
*/
export declare const ProviderUnionSchema: z.ZodDiscriminatedUnion<"provider_type", [z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"http">;
http_method: z.ZodDefault<z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH"]>>;
url: z.ZodString;
content_type: z.ZodDefault<z.ZodString>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
body_field: z.ZodDefault<z.ZodOptional<z.ZodString>>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "http";
http_method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
url: string;
content_type: string;
body_field: string;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
}, {
provider_type: "http";
url: string;
name?: string | undefined;
http_method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | undefined;
content_type?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
}>, z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"sse">;
url: z.ZodString;
event_type: z.ZodOptional<z.ZodString>;
reconnect: z.ZodDefault<z.ZodBoolean>;
retry_timeout: z.ZodDefault<z.ZodNumber>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
body_field: z.ZodOptional<z.ZodString>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "sse";
url: string;
reconnect: boolean;
retry_timeout: number;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
event_type?: string | undefined;
}, {
provider_type: "sse";
url: string;
name?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
event_type?: string | undefined;
reconnect?: boolean | undefined;
retry_timeout?: number | undefined;
}>, z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"http_stream">;
url: z.ZodString;
http_method: z.ZodDefault<z.ZodEnum<["GET", "POST"]>>;
content_type: z.ZodDefault<z.ZodString>;
chunk_size: z.ZodDefault<z.ZodNumber>;
timeout: z.ZodDefault<z.ZodNumber>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
body_field: z.ZodOptional<z.ZodString>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "http_stream";
http_method: "GET" | "POST";
url: string;
content_type: string;
chunk_size: number;
timeout: number;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
}, {
provider_type: "http_stream";
url: string;
name?: string | undefined;
http_method?: "GET" | "POST" | undefined;
content_type?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
body_field?: string | undefined;
header_fields?: string[] | undefined;
chunk_size?: number | undefined;
timeout?: number | undefined;
}>, z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"cli">;
command_name: z.ZodString;
env_vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
working_dir: z.ZodOptional<z.ZodString>;
auth: z.ZodNull;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "cli";
auth: null;
command_name: string;
env_vars?: Record<string, string> | undefined;
working_dir?: string | undefined;
}, {
provider_type: "cli";
auth: null;
command_name: string;
name?: string | undefined;
env_vars?: Record<string, string> | undefined;
working_dir?: string | undefined;
}>, z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"websocket">;
url: z.ZodString;
protocol: z.ZodOptional<z.ZodString>;
keep_alive: z.ZodDefault<z.ZodBoolean>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
header_fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "websocket";
url: string;
keep_alive: boolean;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
protocol?: string | undefined;
}, {
provider_type: "websocket";
url: string;
name?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
headers?: Record<string, string> | undefined;
header_fields?: string[] | undefined;
protocol?: string | undefined;
keep_alive?: boolean | undefined;
}>, z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"grpc">;
host: z.ZodString;
port: z.ZodNumber;
service_name: z.ZodString;
method_name: z.ZodString;
use_ssl: z.ZodDefault<z.ZodBoolean>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"basic">;
username: z.ZodString;
password: z.ZodString;
}, "strip", z.ZodTypeAny, {
auth_type: "basic";
username: string;
password: string;
}, {
auth_type: "basic";
username: string;
password: string;
}>, z.ZodObject<{
auth_type: z.ZodLiteral<"oauth2">;
token_url: z.ZodString;
client_id: z.ZodString;
client_secret: z.ZodString;
scope: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}, {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
}>]>>;
}, "strip", z.ZodTypeAny, {
name: string;
provider_type: "grpc";
host: string;
port: number;
service_name: string;
method_name: string;
use_ssl: boolean;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
}, {
provider_type: "grpc";
host: string;
port: number;
service_name: string;
method_name: string;
name?: string | undefined;
auth?: {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "header" | "query" | "cookie" | undefined;
} | {
auth_type: "basic";
username: string;
password: string;
} | {
auth_type: "oauth2";
token_url: string;
client_id: string;
client_secret: string;
scope?: string | undefined;
} | undefined;
use_ssl?: boolean | undefined;
}>, z.ZodObject<{
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
} & {
provider_type: z.ZodLiteral<"graphql">;
url: z.ZodString;
operation_type: z.ZodDefault<z.ZodEnum<["query", "mutation", "subscription"]>>;
operation_name: z.ZodOptional<z.ZodString>;
auth: z.ZodOptional<z.ZodDiscriminatedUnion<"auth_type", [z.ZodObject<{
auth_type: z.ZodLiteral<"api_key">;
api_key: z.ZodString;
var_name: z.ZodString;
location: z.ZodDefault<z.ZodEnum<["header", "query", "cookie"]>>;
}, "strip", z.ZodTypeAny, {
auth_type: "api_key";
api_key: string;
var_name: string;
location: "header" | "query" | "cookie";
}, {
auth_type: "api_key";
api_key: string;
var_name: string;
location?: "hea