Skip to main content
Glama

manage_plan

Modify or remove subscription plans on the402.ai marketplace. Requires plan owner authentication to update details or delete plans.

Instructions

Update or delete a subscription plan on the402.ai. Only the provider who created the plan can modify it. Requires API key (plan owner).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_idYesThe plan ID
actionYesupdate = modify plan details, delete = remove plan
nameNoNew plan name (for update)
descriptionNoNew description (for update)
priceNoNew price (for update)

Implementation Reference

  • The implementation of the 'manage_plan' tool, which handles updating or deleting subscription plans.
    server.tool(
    	"manage_plan",
    	"Update or delete a subscription plan on the402.ai. Only the provider who created the plan can modify it. Requires API key (plan owner).",
    	{
    		plan_id: z.string().describe("The plan ID"),
    		action: z
    			.enum(["update", "delete"])
    			.describe("update = modify plan details, delete = remove plan"),
    		name: z.string().optional().describe("New plan name (for update)"),
    		description: z
    			.string()
    			.optional()
    			.describe("New description (for update)"),
    		price: z.string().optional().describe("New price (for update)"),
    	},
    	async ({ plan_id, action, name, description, price }) => {
    		if (action === "delete") {
    			const result = await client.authDelete(`/v1/plans/${plan_id}`);
    			return {
    				content: [
    					{ type: "text" as const, text: JSON.stringify(result, null, 2) },
    				],
    			};
    		}
    
    		const body: Record<string, unknown> = {};
    		if (name) body.name = name;
    		if (description) body.description = description;
    		if (price) body.price = price;
    
    		const result = await client.authPut(`/v1/plans/${plan_id}`, 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