add_liquidity
Increase liquidity for a specific market on Manifold Markets by adding mana to its liquidity pool. Enter the market ID and desired mana amount to enhance market stability and trading efficiency.
Instructions
Add mana to market liquidity pool
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of mana to add | |
| marketId | Yes | Market ID |
Input Schema (JSON Schema)
{
"properties": {
"amount": {
"description": "Amount of mana to add",
"type": "number"
},
"marketId": {
"description": "Market ID",
"type": "string"
}
},
"required": [
"marketId",
"amount"
],
"type": "object"
}
Implementation Reference
- src/index.ts:724-760 (handler)The main execution handler for the add_liquidity tool. Validates input with AddLiquiditySchema, authenticates with MANIFOLD_API_KEY, sends POST to Manifold API /add-liquidity endpoint, and returns success response.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', }, ], }; }
- src/index.ts:83-86 (schema)Zod validation schema defining input parameters for add_liquidity: 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 MCP server's tools list, including name, description, and input schema for list tools request.{ 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'], }, },