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,
    					};
    				}
    			},
    		);
    	});
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It clearly states what the tool does (search documentation) and provides usage boundaries, but doesn't disclose behavioral traits like rate limits, authentication requirements, response format, pagination, or error handling. The description adds value by defining scope but lacks operational details.

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

Conciseness4/5

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

The description is well-structured with clear sections: usage restrictions, positive use cases, and parameter overview. It's appropriately sized for the tool's complexity, though the parameter section could be more concise since the schema already covers them. Every sentence adds value by clarifying scope and boundaries.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 3 parameters, 100% schema coverage, and no output schema, the description provides good contextual completeness. It clearly defines the tool's purpose, usage boundaries, and relationship to sibling tools. The main gap is lack of output format information, but given the search nature and good parameter documentation, this is acceptable.

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 description coverage is 100%, so the schema already documents all three parameters thoroughly. The description mentions the parameters but doesn't add meaningful semantic context beyond what's in the schema descriptions. The baseline score of 3 is appropriate when the schema does the heavy lifting.

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 as searching Chargebee documentation for general product queries, distinguishing it from the sibling 'chargebee_code_planner' tool. It specifies the exact scope: documentation about features, concepts, billing, payments, receivables, revenue recognition, and subscription management processes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool (general product documentation queries) and when not to use it (implementation questions, code generation). It specifically names the alternative tool 'chargebee_code_planner' for developer implementation questions and lists acceptable use cases with clear boundaries.

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