Skip to main content
Glama
chargebee

@chargebee/mcp

Official
by chargebee

chargebee_code_planner

Generates integration workflow and code snippets for implementing Chargebee functionality, such as creating subscriptions or handling webhooks, based on your goal and preferred programming language.

Instructions

Use this tool for any Chargebee integration questions or implementation needs.

Always use this tool to get the accurate integration code guide for Chargebee. This is the main tool developers need when asking about implementing Chargebee functionality (like "how to update billing address", "how to create subscription", "how to handle webhooks", etc.).

This tool will take in parameters about integrating with Chargebee in their application and generates an integration workflow along with the code snippets.

It takes the following arguments:

  • goal (string): What is the user's goal?

  • language (enum): Programming language the code to be generated in. Check the user's application language.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalYesWhat is the user's goal?
languageNoProgramming language the code to be generated in. Check the user's application language.

Implementation Reference

  • The execute handler for chargebee_code_planner tool. Calls chargebeeAIClient.getCodePlanner() with the goal and language parameters.
    const generateCodePlanner = async (
    	parameters: z.infer<typeof codePlannerParameters>,
    ) => {
    	try {
    		const results = await chargebeeAIClient.getCodePlanner({
    			query: parameters.goal,
    			language: parameters.language,
    		});
    		return results;
    	} catch (error) {
    		if (error instanceof Error) {
    			console.error('Error generating code planner:', error.message);
    			return `Failed to generate code planner: ${error.message}`;
    		}
    		console.error('Error generating code planner:', error);
    		return 'Failed to generate code planner';
    	}
    };
  • Zod schema defining input parameters: goal (string) and language (enum: node, python, curl, java, go, ruby, php, dotnet), with language optional.
    const codePlannerParameters = z.object({
    	goal: z.string().describe(goalParamDescription),
    	language: z
    		.enum(['node', 'python', 'curl', 'java', 'go', 'ruby', 'php', 'dotnet'])
    		.describe(languageParamDescription)
    		.optional(),
    });
  • Tool configuration object exporting the tool as codePlannerTool with method 'chargebee_code_planner', description, parameters, and execute handler.
    export const codePlannerTool = {
    	method: 'chargebee_code_planner',
    	name: 'Chargebee Code Planner',
    	description: codePlannerPrompt,
    	parameters: codePlannerParameters,
    	execute: generateCodePlanner,
    };
  • Registration in the MCP server: this.tool() is called for each tool in the tools array (line 44-73), including chargebee_code_planner.
    private registerTools() {
    	tools.forEach((tool) => {
    		this.tool(
    			tool.method,
    			tool.description,
    			tool.parameters.shape,
    			async (arg: any) => {
    				try {
    					const result = await tool.execute(arg, this);
    
    					return {
    						content: [
    							{
    								type: 'text' as const,
    								text: JSON.stringify(result, null, 2),
    							},
    						],
    					};
    				} catch (error) {
    					return {
    						content: [
    							{
    								type: 'text' as const,
    								text: `Error: ${error instanceof Error ? error.message : String(error)}`,
    							},
    						],
    						isError: true,
    					};
    				}
    			},
    		);
    	});
  • The getCodePlanner method in ChargebeeAIClient that sends a POST request to /code_planner endpoint with query and language params.
    public getCodePlanner: Method<CodePlannerParams, CodePlannerResponse['result']['content']> = async (
    	params: CodePlannerParams,
    ) => {
    	const response = await this.request<CodePlannerResponse>({
    		endpoint: '/code_planner',
    		method: 'POST',
    		body: JSON.stringify({
    			...params,
    			query: params.query,
           stream: false
    		}),
    	});
    	return response.result.content;
    };
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only describes the tool as generating code but does not clarify that it is a read-only operation with no side effects or data mutations. Such information is essential for safe invocation.

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

Conciseness3/5

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

The description contains redundant phrasing (e.g., 'Use this tool' and 'Always use this tool') and could be more streamlined. However, it is not excessively long and includes necessary details.

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?

The description covers the tool's inputs and high-level output (workflow and code snippets) but lacks details on the output structure, error handling, or limitations. With no output schema, more specifics would improve completeness.

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 coverage is 100%, and the descriptions in the schema are adequate. The tool description reiterates the parameter meanings without adding new context or examples, meeting the baseline for high coverage.

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: generating integration workflows and code snippets for Chargebee. It explicitly differentiates from the sibling tool 'chargebee_documentation_search' by positioning itself as the main tool for implementation questions.

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 advises to use this tool for Chargebee integration needs and to check the user's language. It implies a context for use but does not explicitly exclude scenarios or mention alternatives beyond the sibling.

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/chargebee/agentkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server