create_service
List a new service on the402.ai marketplace by defining its name, description, pricing, category, and input requirements to make it discoverable by AI agents worldwide.
Instructions
List a new service on the the402.ai marketplace as a provider. Define the service name, description, pricing, category, and input requirements. Your service will be discoverable by AI agents worldwide. Requires API key (provider account).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Service name (clear, descriptive, max 100 chars) | |
| description | Yes | Detailed description of what the service does, who it's for, and what agents will receive | |
| category | Yes | Service category (e.g., 'data', 'development', 'content', 'security') | |
| price | Yes | Price in USD (e.g., '0.50', '25.00') | |
| pricing_model | No | fixed = set price, quote_required = negotiate per request (default: fixed) | |
| service_type | No | data_api = instant, automated_service = async processing, human_service = expert work | |
| fulfillment_type | No | How the service is fulfilled | |
| estimated_delivery | No | Estimated delivery time (e.g., '< 1 minute', '24 hours', '3-5 days') | |
| tags | No | Tags for discoverability | |
| input_schema | No | JSON Schema defining required input fields agents must provide when purchasing | |
| webhook_url | No | URL to receive webhook notifications for new orders |
Implementation Reference
- src/tools/services.ts:6-92 (handler)The implementation of the 'create_service' tool, including its registration, Zod schema definition, and handler logic.
server.tool( "create_service", "List a new service on the the402.ai marketplace as a provider. Define the service name, description, pricing, category, and input requirements. Your service will be discoverable by AI agents worldwide. Requires API key (provider account).", { name: z .string() .describe("Service name (clear, descriptive, max 100 chars)"), description: z .string() .describe( "Detailed description of what the service does, who it's for, and what agents will receive" ), category: z .string() .describe( "Service category (e.g., 'data', 'development', 'content', 'security')" ), price: z.string().describe("Price in USD (e.g., '0.50', '25.00')"), pricing_model: z .enum(["fixed", "quote_required"]) .optional() .describe( "fixed = set price, quote_required = negotiate per request (default: fixed)" ), service_type: z .enum(["data_api", "automated_service", "human_service"]) .optional() .describe( "data_api = instant, automated_service = async processing, human_service = expert work" ), fulfillment_type: z .enum(["instant", "async", "human"]) .optional() .describe("How the service is fulfilled"), estimated_delivery: z .string() .optional() .describe( "Estimated delivery time (e.g., '< 1 minute', '24 hours', '3-5 days')" ), tags: z.array(z.string()).optional().describe("Tags for discoverability"), input_schema: z .record(z.unknown()) .optional() .describe( "JSON Schema defining required input fields agents must provide when purchasing" ), webhook_url: z .string() .optional() .describe("URL to receive webhook notifications for new orders"), }, async ({ name, description, category, price, pricing_model, service_type, fulfillment_type, estimated_delivery, tags, input_schema, webhook_url, }) => { const body: Record<string, unknown> = { name, description, category, price, }; if (pricing_model) body.pricing_model = pricing_model; if (service_type) body.service_type = service_type; if (fulfillment_type) body.fulfillment_type = fulfillment_type; if (estimated_delivery) body.estimated_delivery = estimated_delivery; if (tags) body.tags = tags; if (input_schema) body.input_schema = input_schema; if (webhook_url) body.webhook_url = webhook_url; const result = await client.authPost("/v1/services", body); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } );