@mcp-apps/api-tools-mcp-server
Version:
MCP server for interacting with APIs and web services
78 lines (77 loc) • 2.94 kB
TypeScript
import { z } from 'zod';
export declare const apiCallTool: {
name: string;
description: string;
parameters: {
endpoint: z.ZodString;
method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
path: z.ZodOptional<z.ZodString>;
queryParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
body: z.ZodOptional<z.ZodAny>;
authType: z.ZodDefault<z.ZodEnum<["bearer", "basic", "interactive", "none"]>>;
authConfig: z.ZodOptional<z.ZodObject<{
token: z.ZodOptional<z.ZodString>;
username: z.ZodOptional<z.ZodString>;
password: z.ZodOptional<z.ZodString>;
clientId: z.ZodOptional<z.ZodString>;
tenantId: z.ZodOptional<z.ZodString>;
authority: z.ZodOptional<z.ZodString>;
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
redirectUri: z.ZodOptional<z.ZodString>;
useBroker: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
useBroker: boolean;
token?: string | undefined;
username?: string | undefined;
clientId?: string | undefined;
tenantId?: string | undefined;
scopes?: string[] | undefined;
password?: string | undefined;
authority?: string | undefined;
redirectUri?: string | undefined;
}, {
token?: string | undefined;
username?: string | undefined;
clientId?: string | undefined;
tenantId?: string | undefined;
scopes?: string[] | undefined;
password?: string | undefined;
authority?: string | undefined;
redirectUri?: string | undefined;
useBroker?: boolean | undefined;
}>>;
};
handler: ({ endpoint, method, path, queryParams, headers, body, authType, authConfig }: {
endpoint: string;
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
path?: string;
queryParams?: Record<string, string>;
headers?: Record<string, string>;
body?: any;
authType?: "bearer" | "basic" | "interactive" | "none";
authConfig?: {
token?: string;
username?: string;
password?: string;
clientId?: string;
tenantId?: string;
authority?: string;
scopes?: string[] | undefined;
redirectUri?: string;
useBroker?: boolean;
};
}) => Promise<{
content: {
readonly type: "text";
readonly text: string;
}[];
isError?: undefined;
} | {
content: {
readonly type: "text";
readonly text: `Error making API call: ${any}`;
}[];
isError: boolean;
}>;
};