Skip to main content
Glama
bmorphism

Manifold Markets MCP Server

remove_liquidity

Withdraw funds from a prediction market liquidity pool to retrieve your stake and reduce market exposure.

Instructions

Remove liquidity from market pool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractIdYesMarket ID
amountYesAmount of liquidity to remove

Implementation Reference

  • Handler for remove_liquidity tool: validates params with schema, checks API key, POSTs to Manifold API to remove liquidity from market, 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 input schema for remove_liquidity tool defining 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)
    Registration of remove_liquidity tool in the ListTools response, including name, description, and input schema definition.
    { 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'] } },

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