Skip to main content
Glama

Manifold Markets MCP Server

remove_liquidity

Enable users to withdraw specified liquidity amounts from market pools on Manifold Markets by providing the market ID and desired amount.

Instructions

Remove liquidity from market pool

Input Schema

NameRequiredDescriptionDefault
amountYesAmount of liquidity to remove
contractIdYesMarket ID

Input Schema (JSON Schema)

{ "properties": { "amount": { "description": "Amount of liquidity to remove", "type": "number" }, "contractId": { "description": "Market ID", "type": "string" } }, "required": [ "contractId", "amount" ], "type": "object" }

Implementation Reference

  • Handler for remove_liquidity tool: parses params with RemoveLiquiditySchema, authenticates with MANIFOLD_API_KEY, POSTs to Manifold API /v0/market/{contractId}/remove-liquidity with amount, returns success message.
    case 'remove_liquidity': { const params = RemoveLiquiditySchema.parse(args); const apiKey = process.env.MANIFOLD_API_KEY; if (!apiKey) { throw new McpError( ErrorCode.InternalError, 'MANIFOLD_API_KEY environment variable is required' ); } const response = await fetch(`${API_BASE}/v0/market/${params.contractId}/remove-liquidity`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Key ${apiKey}`, }, body: JSON.stringify({ amount: params.amount, }), }); if (!response.ok) { throw new McpError( ErrorCode.InternalError, `Manifold API error: ${response.statusText}` ); } return { content: [ { type: 'text', text: 'Liquidity removed successfully', }, ], }; }
  • Zod schema for remove_liquidity input: requires contractId (string) and amount (positive finite number).
    const RemoveLiquiditySchema = z.object({ contractId: z.string(), amount: z.number().positive().finite(), });
  • src/index.ts:386-397 (registration)
    MCP tool registration for remove_liquidity, including name, description, and inputSchema matching the Zod schema.
    { name: 'remove_liquidity', description: 'Remove liquidity from market pool', inputSchema: { type: 'object', properties: { contractId: { type: 'string', description: 'Market ID' }, amount: { type: 'number', description: 'Amount of liquidity to remove' } }, required: ['contractId', 'amount'] } },

Other Tools

Related Tools

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/bmorphism/manifold-mcp-server'

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