Skip to main content
Glama

manage_product

Create, update, or delete digital products on the402.ai marketplace. Manage one-time purchasable files, datasets, and templates as a provider using API authentication.

Instructions

Create, update, or delete a digital product on the402.ai as a provider. Products are one-time purchasable digital goods (files, datasets, templates). Requires API key (provider account).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYescreate = new product, update = modify existing, delete = remove
product_idNoProduct ID (required for update/delete)
nameNoProduct name (required for create)
descriptionNoProduct description (required for create)
priceNoPrice in USD (required for create)
categoryNoProduct category

Implementation Reference

  • The `manage_product` tool handles create, update, and delete actions for digital products by calling the appropriate client auth methods.
    server.tool(
    	"manage_product",
    	"Create, update, or delete a digital product on the402.ai as a provider. Products are one-time purchasable digital goods (files, datasets, templates). Requires API key (provider account).",
    	{
    		action: z
    			.enum(["create", "update", "delete"])
    			.describe(
    				"create = new product, update = modify existing, delete = remove"
    			),
    		product_id: z
    			.string()
    			.optional()
    			.describe("Product ID (required for update/delete)"),
    		name: z
    			.string()
    			.optional()
    			.describe("Product name (required for create)"),
    		description: z
    			.string()
    			.optional()
    			.describe("Product description (required for create)"),
    		price: z
    			.string()
    			.optional()
    			.describe("Price in USD (required for create)"),
    		category: z.string().optional().describe("Product category"),
    	},
    	async ({ action, product_id, name, description, price, category }) => {
    		if (action === "delete") {
    			if (!product_id) throw new Error("product_id is required for delete");
    			const result = await client.authDelete(`/v1/products/${product_id}`);
    			return {
    				content: [
    					{ type: "text" as const, text: JSON.stringify(result, null, 2) },
    				],
    			};
    		}
    
    		if (action === "update") {
    			if (!product_id) throw new Error("product_id is required for update");
    			const body: Record<string, unknown> = {};
    			if (name) body.name = name;
    			if (description) body.description = description;
    			if (price) body.price = price;
    			if (category) body.category = category;
    			const result = await client.authPut(`/v1/products/${product_id}`, body);
    			return {
    				content: [
    					{ type: "text" as const, text: JSON.stringify(result, null, 2) },
    				],
    			};
    		}
    
    		// create
    		if (!name || !description || !price)
    			throw new Error(
    				"name, description, and price are required to create a product"
    			);
    		const body: Record<string, unknown> = { name, description, price };
    		if (category) body.category = category;
    
    		// Note: file upload requires multipart — for CLI creation, product metadata only.
    		// File can be uploaded separately via the dashboard.
    		const result = await client.authPost("/v1/products", body);
    		return {
    			content: [
    				{ type: "text" as const, text: JSON.stringify(result, null, 2) },
    			],
    		};
    	}
    );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that it requires an API key for provider accounts, which is useful context. However, it doesn't mention other behavioral traits like rate limits, error handling, or what happens on deletion (e.g., if data is permanently removed). The description doesn't contradict annotations, but it lacks comprehensive behavioral details for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by clarifying details. Every sentence earns its place: the first defines actions and context, the second specifies product types, and the third states prerequisites. No wasted words, and it's appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides basic context (purpose, provider requirement, product types) but lacks details on behavioral aspects like mutation effects, error cases, or response format. For a tool with 6 parameters and mutation actions, this is adequate but has clear gaps, especially around output and operational constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema—it mentions 'digital goods (files, datasets, templates)' which gives context for the 'product' resource but doesn't elaborate on parameter usage or constraints. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Create, update, or delete a digital product on the402.ai as a provider.' It specifies the resource (digital product), the actions (create/update/delete), and distinguishes it from siblings like 'browse_products' or 'purchase_product' by focusing on provider-side management rather than browsing or purchasing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: 'as a provider' and 'Requires API key (provider account),' indicating when to use this tool (for provider operations). It doesn't explicitly state when not to use it or name alternatives, but the provider context implicitly distinguishes it from consumer tools like 'purchase_product' or 'browse_products.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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