Skip to main content
Glama

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
NameRequiredDescriptionDefault
nameYesService name (clear, descriptive, max 100 chars)
descriptionYesDetailed description of what the service does, who it's for, and what agents will receive
categoryYesService category (e.g., 'data', 'development', 'content', 'security')
priceYesPrice in USD (e.g., '0.50', '25.00')
pricing_modelNofixed = set price, quote_required = negotiate per request (default: fixed)
service_typeNodata_api = instant, automated_service = async processing, human_service = expert work
fulfillment_typeNoHow the service is fulfilled
estimated_deliveryNoEstimated delivery time (e.g., '< 1 minute', '24 hours', '3-5 days')
tagsNoTags for discoverability
input_schemaNoJSON Schema defining required input fields agents must provide when purchasing
webhook_urlNoURL to receive webhook notifications for new orders

Implementation Reference

  • 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) },
    			],
    		};
    	}
    );

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/the402ai/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server