Skip to main content
Glama

OKX-DEX-SDK MCP SSE Server

by 0xobedient
getQuoteTool.ts•1.11 kB
import { Tool } from "./../../shared/types/tool"; import { QuoteParams } from "@okx-dex/okx-dex-sdk"; import { z } from "zod"; import { get_quote } from "../hooks"; export const getQuoteToolParams = { chainId: z.string(), chainIndex: z.string().optional(), fromTokenAddress: z.string(), toTokenAddress: z.string(), amount: z.string(), userWalletAddress: z.string().optional(), dexIds: z.string().optional(), directRoute: z.boolean().optional(), priceImpactProtectionPercentage: z.string().optional(), feePercent: z.string().optional(), slippage: z.string(), }; export const getQuoteToolZodParams = z.object({ ...getQuoteToolParams, }); export type GetQuoteToolParamType = z.infer<typeof getQuoteToolZodParams>; export const getQuoteTool: Tool< typeof getQuoteToolParams, GetQuoteToolParamType, string > = { name: "OKX_DEX_GET_QUOTE", description: "Get the best quote for a swap through OKX DEX.", parameters: { ...getQuoteToolParams, }, callback: async (params: GetQuoteToolParamType): Promise<string> => { return get_quote(params as QuoteParams); }, };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xobedient/okx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server