Skip to main content
Glama

update_service

Modify service listings on the402.ai marketplace. Change price, description, status, delivery time, or other fields to keep offerings current.

Instructions

Update an existing service listing on the402.ai. Change price, description, status (active/inactive), or any other field. Requires API key (service owner only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_idYesThe service ID to update
nameNoNew service name
descriptionNoNew description
priceNoNew price in USD
statusNoSet active or inactive
estimated_deliveryNoNew estimated delivery time
tagsNoNew tags
input_schemaNoNew input schema
webhook_urlNoNew webhook URL

Implementation Reference

  • Handler function for the update_service tool. It gathers non-empty parameters and performs an authenticated PUT request to the API.
    async ({
    	service_id,
    	name,
    	description,
    	price,
    	status,
    	estimated_delivery,
    	tags,
    	input_schema,
    	webhook_url,
    }) => {
    	const body: Record<string, unknown> = {};
    	if (name) body.name = name;
    	if (description) body.description = description;
    	if (price) body.price = price;
    	if (status) body.status = status;
    	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.authPut(`/v1/services/${service_id}`, body);
    	return {
    		content: [
    			{ type: "text" as const, text: JSON.stringify(result, null, 2) },
    		],
    	};
    }
  • Zod schema definition for update_service tool inputs.
    {
    	service_id: z.string().describe("The service ID to update"),
    	name: z.string().optional().describe("New service name"),
    	description: z.string().optional().describe("New description"),
    	price: z.string().optional().describe("New price in USD"),
    	status: z
    		.enum(["active", "inactive"])
    		.optional()
    		.describe("Set active or inactive"),
    	estimated_delivery: z
    		.string()
    		.optional()
    		.describe("New estimated delivery time"),
    	tags: z.array(z.string()).optional().describe("New tags"),
    	input_schema: z
    		.record(z.unknown())
    		.optional()
    		.describe("New input schema"),
    	webhook_url: z.string().optional().describe("New webhook URL"),
    },
  • Registration of the update_service tool with the MCP server.
    server.tool(
    	"update_service",
    	"Update an existing service listing on the402.ai. Change price, description, status (active/inactive), or any other field. Requires API key (service owner only).",

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