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
| Name | Required | Description | Default |
|---|---|---|---|
| service_id | Yes | The service ID to update | |
| name | No | New service name | |
| description | No | New description | |
| price | No | New price in USD | |
| status | No | Set active or inactive | |
| estimated_delivery | No | New estimated delivery time | |
| tags | No | New tags | |
| input_schema | No | New input schema | |
| webhook_url | No | New webhook URL |
Implementation Reference
- src/tools/services.ts:117-144 (handler)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) }, ], }; } - src/tools/services.ts:97-116 (schema)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"), }, - src/tools/services.ts:94-96 (registration)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).",