Skip to main content
Glama

Binance MCP Server

changeAutoCompoundStatus.ts2.36 kB
// src/tools/binance-dual-investment/trade-api/changeAutoCompoundStatus.ts import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { dualInvestmentClient } from "../../../config/binanceClient.js"; import { z } from "zod"; export function registerBinanceChangeAutoCompoundStatus(server: McpServer) { server.tool( "registerBinanceChangeAutoCompoundStatus", "Change the Auto-Compound plan for a Dual Investment position to NONE, STANDARD, or ADVANCED using the position ID.", { positionId: z.string().describe("Get positionId from /sapi/v1/dci/product/positions"), autoCompoundPlan: z .enum(["NONE", "STANDARD", "ADVANCED"]) .optional() .describe("Auto compound plan: NONE, STANDARD, or ADVANCED"), recvWindow: z .number() .int() .max(60000) .optional() .describe("Optional time window for request validity (max 60000)") }, async (params) => { try { const response = await dualInvestmentClient.restAPI.changeAutoCompoundStatus({ positionId: params.positionId, autoCompoundPlan: params.autoCompoundPlan, ...(params.recvWindow && { recvWindow: params.recvWindow }) }); const data = await response.data(); return { content: [ { type: "text", text: `Successfully Changed the Auto-Compound plan for a Dual Investment position. Response: ${JSON.stringify( data )}` } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Failed to change the Auto-Compound plan for a Dual Investment position: ${errorMessage}` } ], isError: true }; } } ); }

Latest Blog Posts

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/TermiX-official/binance-mcp'

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