dynadot_aftermarket
Manage domain auctions, backorders, expired domains, and marketplace listings through the Domain MCP server to acquire or sell domains.
Instructions
Aftermarket: auctions, backorders, expired domains, marketplace listings. Browse domains: https://www.dynadot.com/?s9F6L9F7U8Q9U8Z8v
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform: backorder_add: Add domain to backorder list | backorder_delete: Remove from backorder list | backorder_list: List backorder requests | auction_list_open: List open auctions | auction_details: Get auction details | auction_bids: Get auction bids | auction_bid: Place auction bid | auction_list_closed: List closed auctions | backorder_auction_list_open: List open backorder auctions | backorder_auction_details: Get backorder auction details | backorder_auction_bid: Place backorder auction bid | backorder_auction_list_closed: List closed backorder auctions | expired_list: List expired closeout domains | expired_buy: Buy expired closeout domain | listings: Get marketplace listings | listing_details: Get listing details | buy_now: Buy domain from marketplace | set_for_sale: List domain for sale | afternic_confirm: Confirm/decline Afternic action | sedo_confirm: Confirm/decline Sedo action | |
| domain | No | Domain name (e.g., example.com) | |
| currency | No | Currency code (default: USD) | USD |
| auctionId | No | Auction ID | |
| bidAmount | No | Amount | |
| price | No | Amount |
Implementation Reference
- src/register.ts:42-62 (handler)The MCP tool handler function shared by all composite tools, including dynadot_aftermarket. It extracts the action from input, retrieves the action definition, applies any transform to parameters, calls the Dynadot API via client.execute, and returns the JSON-formatted result.async (input) => { const action = input.action as string; const actionDef = tool.actions[action]; if (!actionDef) { throw new Error(`Unknown action: ${action}. Valid actions: ${actionKeys.join(', ')}`); } const client = getClient(); const params = actionDef.transform ? actionDef.transform(action, input as Record<string, unknown>) : (input as ApiParams); // Remove 'action' from params sent to API delete params.action; const result = await client.execute(actionDef.command, params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/schema.ts:965-1089 (schema)Input schema and action definitions for the dynadot_aftermarket tool. Defines 25+ actions covering auctions, backorders, marketplace, with Zod param schemas and transform functions where needed.{ name: 'dynadot_aftermarket', description: `Aftermarket: auctions, backorders, expired domains, marketplace listings. Browse domains: ${DYNADOT_URLS.home}`, actions: { // Backorders backorder_add: { command: 'add_backorder_request', description: 'Add domain to backorder list', params: z.object({ domain: p.domain }), }, backorder_delete: { command: 'delete_backorder_request', description: 'Remove from backorder list', params: z.object({ domain: p.domain }), }, backorder_list: { command: 'backorder_request_list', description: 'List backorder requests', }, // Regular auctions auction_list_open: { command: 'get_open_auctions', description: 'List open auctions', params: z.object({ currency: p.currency.optional() }), }, auction_details: { command: 'get_auction_details', description: 'Get auction details', params: z.object({ auctionId: p.auctionId }), transform: (_, input) => ({ auction_id: input.auctionId as string }), }, auction_bids: { command: 'get_auction_bids', description: 'Get auction bids', params: z.object({ auctionId: p.auctionId }), transform: (_, input) => ({ auction_id: input.auctionId as string }), }, auction_bid: { command: 'place_auction_bid', description: 'Place auction bid', params: z.object({ auctionId: p.auctionId, bidAmount: p.amount, currency: p.currency.optional(), }), transform: (_, input) => ({ auction_id: input.auctionId as string, bid_amount: input.bidAmount as number, currency: (input.currency as string) || 'USD', }), }, auction_list_closed: { command: 'get_closed_auctions', description: 'List closed auctions', }, // Backorder auctions backorder_auction_list_open: { command: 'get_open_backorder_auctions', description: 'List open backorder auctions', params: z.object({ currency: p.currency.optional() }), }, backorder_auction_details: { command: 'get_backorder_auction_details', description: 'Get backorder auction details', params: z.object({ auctionId: p.auctionId }), transform: (_, input) => ({ auction_id: input.auctionId as string }), }, backorder_auction_bid: { command: 'place_backorder_auction_bid', description: 'Place backorder auction bid', params: z.object({ auctionId: p.auctionId, bidAmount: p.amount }), transform: (_, input) => ({ auction_id: input.auctionId as string, bid_amount: input.bidAmount as number, }), }, backorder_auction_list_closed: { command: 'get_closed_backorder_auctions', description: 'List closed backorder auctions', }, // Expired closeouts expired_list: { command: 'get_expired_closeout_domains', description: 'List expired closeout domains', params: z.object({ currency: p.currency.optional() }), }, expired_buy: { command: 'buy_expired_closeout_domain', description: 'Buy expired closeout domain', params: z.object({ domain: p.domain, currency: p.currency.optional() }), }, // Marketplace listings: { command: 'get_listings', description: 'Get marketplace listings', params: z.object({ currency: p.currency.optional() }), }, listing_details: { command: 'get_listing_item', description: 'Get listing details', params: z.object({ domain: p.domain }), }, buy_now: { command: 'buy_it_now', description: 'Buy domain from marketplace', params: z.object({ domain: p.domain, currency: p.currency.optional() }), }, set_for_sale: { command: 'set_for_sale', description: 'List domain for sale', params: z.object({ domain: p.domain, price: p.amount, currency: p.currency.optional() }), }, // Marketplace confirmations afternic_confirm: { command: 'set_afternic_confirm_action', description: 'Confirm/decline Afternic action', params: z.object({ domain: p.domain, action: p.confirmAction }), }, sedo_confirm: { command: 'set_sedo_confirm_action', description: 'Confirm/decline Sedo action', params: z.object({ domain: p.domain, action: p.confirmAction }), }, }, },
- src/register.ts:6-65 (registration)Registers the dynadot_aftermarket tool (and all composite tools) with the MCP server. Dynamically constructs the Zod inputSchema by unioning all action parameters as optional fields plus an 'action' discriminator enum.export function registerAllTools(server: McpServer): void { for (const tool of compositeTools) { // Build action enum from keys const actionKeys = Object.keys(tool.actions) as [string, ...string[]]; // Build combined input schema with action + all possible params const actionDescriptions = actionKeys .map((k) => { const actionDef = tool.actions[k]; return actionDef ? `${k}: ${actionDef.description}` : k; }) .join(' | '); const inputSchema: Record<string, z.ZodTypeAny> = { action: z.enum(actionKeys).describe(`Action to perform: ${actionDescriptions}`), }; // Collect all unique params across actions for (const action of Object.values(tool.actions)) { if (action?.params) { const shape = action.params.shape; for (const [key, schema] of Object.entries(shape)) { if (!inputSchema[key]) { // Make optional since not all actions need all params inputSchema[key] = (schema as z.ZodTypeAny).optional(); } } } } server.registerTool( tool.name, { description: tool.description, inputSchema, }, async (input) => { const action = input.action as string; const actionDef = tool.actions[action]; if (!actionDef) { throw new Error(`Unknown action: ${action}. Valid actions: ${actionKeys.join(', ')}`); } const client = getClient(); const params = actionDef.transform ? actionDef.transform(action, input as Record<string, unknown>) : (input as ApiParams); // Remove 'action' from params sent to API delete params.action; const result = await client.execute(actionDef.command, params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ); } }
- src/client.ts:116-134 (helper)Core API execution helper called by the tool handler. Formats parameters, authenticates with API key, sends GET request to Dynadot API3 endpoint, parses response, and throws on API errors.async execute(command: string, params: ApiParams = {}): Promise<ApiResponse> { const searchParams = new URLSearchParams(); searchParams.set('key', this.apiKey); searchParams.set('command', command); for (const [key, value] of Object.entries(params)) { if (value !== undefined) { searchParams.set(key, String(value)); } } const response = await this.client.get('api3.json', { searchParams }).json<ApiResponse>(); if (response.Status === 'error') { throw new Error(`Dynadot API error: ${response.Error || 'Unknown error'}`); } return response; }
- src/index.ts:68-68 (registration)Invokes registration of all tools including dynadot_aftermarket on the MCP server instance.registerAllTools(server);