@utcp/sdk
Version:
Universal Tool Calling Protocol (UTCP) client library for TypeScript
1,439 lines (1,438 loc) • 48.1 kB
TypeScript
import { z } from 'zod';
/**
* Schema for defining tool input and output schemas
*/
export declare const ToolInputOutputSchema: z.ZodObject<{
type: z.ZodDefault<z.ZodString>;
properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
description: z.ZodOptional<z.ZodString>;
title: z.ZodOptional<z.ZodString>;
items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
enum: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
minimum: z.ZodOptional<z.ZodNumber>;
maximum: z.ZodOptional<z.ZodNumber>;
format: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
type: string;
properties: Record<string, any>;
minimum?: number | undefined;
maximum?: number | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
}, {
minimum?: number | undefined;
type?: string | undefined;
maximum?: number | undefined;
properties?: Record<string, any> | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
}>;
export type ToolInputOutputSchema = z.infer<typeof ToolInputOutputSchema>;
/**
* Schema for a UTCP Tool
*/
export declare const ToolSchema: z.ZodObject<{
name: z.ZodString;
description: z.ZodDefault<z.ZodString>;
inputs: z.ZodDefault<z.ZodObject<{
type: z.ZodDefault<z.ZodString>;
properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
description: z.ZodOptional<z.ZodString>;
title: z.ZodOptional<z.ZodString>;
items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
enum: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
minimum: z.ZodOptional<z.ZodNumber>;
maximum: z.ZodOptional<z.ZodNumber>;
format: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
type: string;
properties: Record<string, any>;
minimum?: number | undefined;
maximum?: number | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
}, {
minimum?: number | undefined;
type?: string | undefined;
maximum?: number | undefined;
properties?: Record<string, any> | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
}>>;
outputs: z.ZodDefault<z.ZodObject<{
type: z.ZodDefault<z.ZodString>;
properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
description: z.ZodOptional<z.ZodString>;
title: z.ZodOptional<z.ZodString>;
items: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
enum: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
minimum: z.ZodOptional<z.ZodNumber>;
maximum: z.ZodOptional<z.ZodNumber>;
format: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
type: string;
properties: Record<string, any>;
minimum?: number | undefined;
maximum?: number | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
}, {
minimum?: number | undefined;
type?: string | undefined;
maximum?: number | undefined;
properties?: Record<string, any> | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
}>>;
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
average_response_size: z.ZodOptional<z.ZodNumber>;
tool_provider: 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?: "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;
}>, 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;
}>, 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;
}>, 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;
}>, 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;
}>, 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;
}>]>;
}, "strip", z.ZodTypeAny, {
name: string;
description: string;
inputs: {
type: string;
properties: Record<string, any>;
minimum?: number | undefined;
maximum?: number | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
};
outputs: {
type: string;
properties: Record<string, any>;
minimum?: number | undefined;
maximum?: number | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
};
tags: string[];
tool_provider: {
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;
} | {
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;
} | {
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;
} | {
name: string;
provider_type: "cli";
auth: null;
command_name: string;
env_vars?: Record<string, string> | undefined;
working_dir?: string | undefined;
} | {
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;
} | {
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;
} | {
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;
} | {
name: string;
provider_type: "tcp";
auth: null;
timeout: number;
host: string;
port: number;
} | {
name: string;
provider_type: "udp";
auth: null;
timeout: number;
host: string;
port: number;
} | {
name: string;
provider_type: "webrtc";
auth: null;
signaling_server: string;
peer_id: string;
data_channel_name: string;
} | {
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;
} | {
name: string;
provider_type: "text";
auth: null;
file_path: string;
};
average_response_size?: number | undefined;
}, {
name: string;
tool_provider: {
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;
} | {
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;
} | {
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;
} | {
provider_type: "cli";
auth: null;
command_name: string;
name?: string | undefined;
env_vars?: Record<string, string> | undefined;
working_dir?: 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;
} | {
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;
} | {
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;
} | {
provider_type: "tcp";
auth: null;
host: string;
port: number;
name?: string | undefined;
timeout?: number | undefined;
} | {
provider_type: "udp";
auth: null;
host: string;
port: number;
name?: string | undefined;
timeout?: number | undefined;
} | {
provider_type: "webrtc";
auth: null;
signaling_server: string;
peer_id: string;
name?: string | undefined;
data_channel_name?: string | 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;
} | {
provider_type: "text";
file_path: string;
name?: string | undefined;
auth?: null | undefined;
};
description?: string | undefined;
inputs?: {
minimum?: number | undefined;
type?: string | undefined;
maximum?: number | undefined;
properties?: Record<string, any> | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
} | undefined;
outputs?: {
minimum?: number | undefined;
type?: string | undefined;
maximum?: number | undefined;
properties?: Record<string, any> | undefined;
required?: string[] | undefined;
description?: string | undefined;
title?: string | undefined;
items?: Record<string, any> | undefined;
enum?: any[] | undefined;
format?: string | undefined;
} | undefined;
tags?: string[] | undefined;
average_response_size?: number | undefined;
}>;
export type Tool = z.infer<typeof ToolSchema>;