Skip to main content
Glama

chargebee_code_planner

Generate precise integration workflows and code snippets for implementing Chargebee functionality, such as updating billing addresses, creating subscriptions, or handling webhooks, in your 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

  • Handler function that executes the chargebee_code_planner tool logic by calling chargebeeAIClient.getCodePlanner with the provided goal and optional language, handling errors gracefully.
    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 the input parameters for the chargebee_code_planner tool: required 'goal' string and optional 'language' enum.
    const codePlannerParameters = z.object({ goal: z.string().describe(goalParamDescription), language: z .enum(['node', 'python', 'curl', 'java', 'go', 'ruby', 'php', 'dotnet']) .describe(languageParamDescription) .optional(), });
  • Tool object definition exporting the chargebee_code_planner with its method name, description, parameters schema, and execute handler.
    /** * Tool configuration for Chargebee Code Planner */ export const codePlannerTool = { method: 'chargebee_code_planner', name: 'Chargebee Code Planner', description: codePlannerPrompt, parameters: codePlannerParameters, execute: generateCodePlanner, };
  • MCP server method that registers all tools, including chargebee_code_planner, by iterating over the tools array and calling this.tool() with the tool's method, description, schema shape, and wrapped execute handler.
    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, }; } }, ); }); }
  • Helper method in ChargebeeAIClient that makes the actual API request to '/code_planner' endpoint, which is invoked by the tool handler.
    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; };

Other Tools

Related 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