Skip to main content
Glama
bmorphism

Manifold Markets MCP Server

add_liquidity

Add mana to a market's liquidity pool on Manifold Markets to facilitate trading and improve market stability.

Instructions

Add mana to market liquidity pool

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketIdYesMarket ID
amountYesAmount of mana to add

Implementation Reference

  • Handler for the 'add_liquidity' tool. Validates input using AddLiquiditySchema, requires MANIFOLD_API_KEY, sends POST request to Manifold Markets API to add liquidity to the specified market, and returns a success message.
    case 'add_liquidity': { const params = AddLiquiditySchema.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.marketId}/add-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 added successfully', }, ], }; }
  • Zod schema defining the input parameters for the add_liquidity tool: marketId (string) and amount (positive number).
    const AddLiquiditySchema = z.object({ marketId: z.string(), amount: z.number().positive(), });
  • src/index.ts:290-301 (registration)
    Tool registration in the listTools handler, specifying name, description, and inputSchema for the MCP client.
    { name: 'add_liquidity', description: 'Add mana to market liquidity pool', inputSchema: { type: 'object', properties: { marketId: { type: 'string', description: 'Market ID' }, amount: { type: 'number', description: 'Amount of mana to add' }, }, required: ['marketId', '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