Skip to main content
Glama
chargebee

@chargebee/mcp

Official
by chargebee

chargebee_documentation_search

Search Chargebee documentation to understand billing concepts, subscription management, and product features without implementation details.

Instructions

Only use this tool for general product documentation queries, NOT for implementation questions.

Do not use this tool for code generation or implementation questions. For any developer questions about implementing Chargebee functionality (like "how to update billing address", "how to create subscription", etc.), use "chargebee_code_planner" tool instead.

This tool should only be used for:

  • General product documentation queries about Chargebee's features and concepts

  • Understanding billing, payments, receivables, revenue recognition concepts

  • Learning about subscription management processes

  • Finding product feature explanations and overviews

  • Non-implementation related documentation queries

It takes the following arguments:

  • query (string): The user query to search an answer for in the Chargebee documentation.

  • language (enum): The programming language for the documentation. Check the user's application language.

  • userRequest (string): User's original request to you.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe user query to search an answer for in the Chargebee documentation.
userRequestNoUser's original request to you.
languageNoThe programming language for the documentation. Check the user's application language.

Implementation Reference

  • The async documentationSearch function that implements the core logic of the chargebee_documentation_search tool by querying the Chargebee AI client.
    const documentationSearch = async ( parameters: z.infer<typeof documentationSearchParameters>, ) => { try { const results = await chargebeeAIClient.documentationSearch({ query: parameters.query, filters: { language: parameters.language, }, userRequest: parameters.userRequest, }); return results; } catch (error) { if (error instanceof Error) { console.error('Error searching documentation:', error.message); return `Failed to search documentation: ${error.message}`; } console.error('Error searching documentation:', error); return 'Failed to search documentation'; } };
  • Zod schema defining the input parameters for the chargebee_documentation_search tool: query, optional userRequest, and optional language.
    const documentationSearchParameters = z.object({ query: z.string().describe(queryParamDescription), userRequest: z.string().describe(userRequestParamDescription).optional(), language: z .enum([ 'node', 'python', 'curl', 'java', 'go', 'ruby', 'php', 'dotnet', ]) .describe(languageParamDescription) .optional(), });
  • Export of the tool object registering the method name 'chargebee_documentation_search', description, parameters schema, and execute handler.
    export const documentationSearchTool = { method: 'chargebee_documentation_search', name: 'Chargebee Documentation Search', description: documentationSearchPrompt, parameters: documentationSearchParameters, execute: documentationSearch, };
  • Imports the documentationSearchTool and includes it in the central tools array used for MCP server registration.
    import { Tool } from '../types.js'; import { documentationSearchTool } from './documentation-search.js'; import { codePlannerTool } from './code-planner.js'; export const tools: Tool[] = [ codePlannerTool, documentationSearchTool, ];
  • The registerTools method in ChargebeeMCPServer that iterates over the tools array and registers each tool with the MCP server using its method name, description, parameters, and wrapped execute function.
    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, }; } }, ); }); }

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