Skip to main content
Glama

subscribe_to_plan

Subscribe to a plan on the402.ai marketplace using pre-funded balance for bundled AI services with auto-renewal.

Instructions

Subscribe to a plan on the402.ai. Pays the first billing period from your pre-funded balance. Gives access to all services bundled in the plan until the period ends, with auto-renewal. Requires API key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_idYesThe plan ID to subscribe to

Implementation Reference

  • The "subscribe_to_plan" tool is defined and registered here. The handler logic directly makes a balance-authorized POST request to the API.
    server.tool(
    	"subscribe_to_plan",
    	"Subscribe to a plan on the402.ai. Pays the first billing period from your pre-funded balance. Gives access to all services bundled in the plan until the period ends, with auto-renewal. Requires API key.",
    	{
    		plan_id: z.string().describe("The plan ID to subscribe to"),
    	},
    	async ({ plan_id }) => {
    		const result = await client.balancePost(`/v1/plans/${plan_id}/subscribe`);
    		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