Skip to main content
Glama
Vanshika-Rana

Payman AI Documentation MCP Server

solve-problem

Resolve PaymanAI integration issues by describing your problem and specifying the SDK (nodejs or python) for targeted assistance.

Instructions

Get help with common PaymanAI integration issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
problemYesDescribe the issue you're experiencing
sdkNoWhich SDK you're using (nodejs or python)

Implementation Reference

  • The handler function implements the core logic for 'solve-problem': logs input, defines problem categories with keywords/topics, matches input to categories, generates SDK-specific advice, general troubleshooting steps, and lists relevant documentation topics to consult.
    async ({ problem, sdk }) => {
    	log(`Solving problem: "${problem}" for SDK: ${sdk || "any"}`);
    
    	const problemCategories = [
    		{
    			category: "Authentication",
    			keywords: [
    				"api key",
    				"auth",
    				"authentication",
    				"unauthorized",
    				"401",
    			],
    			topics: ["api-keys", "error-handling"],
    		},
    		{
    			category: "Payments",
    			keywords: [
    				"payment",
    				"send payment",
    				"transaction",
    				"failed payment",
    			],
    			topics: ["send-payments", "error-handling"],
    		},
    		{
    			category: "Payees",
    			keywords: ["payee", "recipient", "create payee", "add payee"],
    			topics: ["create-payee", "create-payees"],
    		},
    		{
    			category: "Setup",
    			keywords: [
    				"install",
    				"setup",
    				"configuration",
    				"sdk",
    				"initialize",
    			],
    			topics: ["setup-and-installation", "quickstart"],
    		},
    		{
    			category: "Error Handling",
    			keywords: ["error", "exception", "crash", "failed"],
    			topics: ["error-handling", "api-reference"],
    		},
    	];
    
    	const problemLower = problem.toLowerCase();
    	const matchingCategories = problemCategories.filter((cat) =>
    		cat.keywords.some((keyword) => problemLower.includes(keyword))
    	);
    
    	const topicsToConsult =
    		matchingCategories.length > 0
    			? matchingCategories.flatMap((cat) => cat.topics)
    			: ["error-handling", "api-reference", "quickstart"];
    
    	const uniqueTopics = [...new Set(topicsToConsult)];
    
    	let solutionText = `# Solution for: "${problem}"\n\n`;
    
    	if (matchingCategories.length > 0) {
    		solutionText += `This appears to be a ${matchingCategories
    			.map((c) => c.category)
    			.join("/")} related issue.\n\n`;
    	}
    
    	if (sdk) {
    		solutionText += `## ${sdk.toUpperCase()} SDK Specific Guidance\n\n`;
    		solutionText += `When working with the ${sdk} SDK, make sure to:\n\n`;
    
    		if (sdk === "nodejs") {
    			solutionText += `- Check you're using the latest version: \`npm view @paymanai/sdk version\`\n`;
    			solutionText += `- Update if needed: \`npm install @paymanai/sdk@latest\`\n`;
    			solutionText += `- Verify your environment variables are set correctly\n`;
    			solutionText += `- Use try/catch blocks to properly handle API errors\n\n`;
    		} else {
    			solutionText += `- Check you're using the latest version: \`pip show paymanai\`\n`;
    			solutionText += `- Update if needed: \`pip install --upgrade paymanai\`\n`;
    			solutionText += `- Handle exceptions properly with try/except blocks\n`;
    			solutionText += `- Ensure your Python version is compatible (3.7+)\n\n`;
    		}
    	}
    
    	solutionText += `## Troubleshooting Steps\n\n`;
    	solutionText += `1. **Check your API credentials** - Verify your API key is valid and correctly formatted\n`;
    	solutionText += `2. **Look for specific error codes** - Error codes provide detailed information about what went wrong\n`;
    	solutionText += `3. **Check your request format** - Ensure all required parameters are included and properly formatted\n`;
    	solutionText += `4. **Review rate limits** - Make sure you're not exceeding API rate limits\n\n`;
    
    	solutionText += `## Relevant Documentation\n\n`;
    	uniqueTopics.forEach((topic) => {
    		solutionText += `- ${topicMetadata[topic].title}: use get-documentation with topic "${topic}"\n`;
    	});
    
    	return {
    		content: [
    			{
    				type: "text",
    				text: solutionText,
    			},
    		],
    	};
    }
  • Zod schema defining inputs for 'solve-problem' tool: required 'problem' string and optional 'sdk' enum.
    {
    	problem: z.string().describe("Describe the issue you're experiencing"),
    	sdk: z
    		.enum(["nodejs", "python"])
    		.optional()
    		.describe("Which SDK you're using (nodejs or python)"),
    },
  • src/index.ts:398-513 (registration)
    Registers the 'solve-problem' tool on the MCP server with name, description, input schema, and handler function.
    server.tool(
    	"solve-problem",
    	"Get help with common PaymanAI integration issues",
    	{
    		problem: z.string().describe("Describe the issue you're experiencing"),
    		sdk: z
    			.enum(["nodejs", "python"])
    			.optional()
    			.describe("Which SDK you're using (nodejs or python)"),
    	},
    	async ({ problem, sdk }) => {
    		log(`Solving problem: "${problem}" for SDK: ${sdk || "any"}`);
    
    		const problemCategories = [
    			{
    				category: "Authentication",
    				keywords: [
    					"api key",
    					"auth",
    					"authentication",
    					"unauthorized",
    					"401",
    				],
    				topics: ["api-keys", "error-handling"],
    			},
    			{
    				category: "Payments",
    				keywords: [
    					"payment",
    					"send payment",
    					"transaction",
    					"failed payment",
    				],
    				topics: ["send-payments", "error-handling"],
    			},
    			{
    				category: "Payees",
    				keywords: ["payee", "recipient", "create payee", "add payee"],
    				topics: ["create-payee", "create-payees"],
    			},
    			{
    				category: "Setup",
    				keywords: [
    					"install",
    					"setup",
    					"configuration",
    					"sdk",
    					"initialize",
    				],
    				topics: ["setup-and-installation", "quickstart"],
    			},
    			{
    				category: "Error Handling",
    				keywords: ["error", "exception", "crash", "failed"],
    				topics: ["error-handling", "api-reference"],
    			},
    		];
    
    		const problemLower = problem.toLowerCase();
    		const matchingCategories = problemCategories.filter((cat) =>
    			cat.keywords.some((keyword) => problemLower.includes(keyword))
    		);
    
    		const topicsToConsult =
    			matchingCategories.length > 0
    				? matchingCategories.flatMap((cat) => cat.topics)
    				: ["error-handling", "api-reference", "quickstart"];
    
    		const uniqueTopics = [...new Set(topicsToConsult)];
    
    		let solutionText = `# Solution for: "${problem}"\n\n`;
    
    		if (matchingCategories.length > 0) {
    			solutionText += `This appears to be a ${matchingCategories
    				.map((c) => c.category)
    				.join("/")} related issue.\n\n`;
    		}
    
    		if (sdk) {
    			solutionText += `## ${sdk.toUpperCase()} SDK Specific Guidance\n\n`;
    			solutionText += `When working with the ${sdk} SDK, make sure to:\n\n`;
    
    			if (sdk === "nodejs") {
    				solutionText += `- Check you're using the latest version: \`npm view @paymanai/sdk version\`\n`;
    				solutionText += `- Update if needed: \`npm install @paymanai/sdk@latest\`\n`;
    				solutionText += `- Verify your environment variables are set correctly\n`;
    				solutionText += `- Use try/catch blocks to properly handle API errors\n\n`;
    			} else {
    				solutionText += `- Check you're using the latest version: \`pip show paymanai\`\n`;
    				solutionText += `- Update if needed: \`pip install --upgrade paymanai\`\n`;
    				solutionText += `- Handle exceptions properly with try/except blocks\n`;
    				solutionText += `- Ensure your Python version is compatible (3.7+)\n\n`;
    			}
    		}
    
    		solutionText += `## Troubleshooting Steps\n\n`;
    		solutionText += `1. **Check your API credentials** - Verify your API key is valid and correctly formatted\n`;
    		solutionText += `2. **Look for specific error codes** - Error codes provide detailed information about what went wrong\n`;
    		solutionText += `3. **Check your request format** - Ensure all required parameters are included and properly formatted\n`;
    		solutionText += `4. **Review rate limits** - Make sure you're not exceeding API rate limits\n\n`;
    
    		solutionText += `## Relevant Documentation\n\n`;
    		uniqueTopics.forEach((topic) => {
    			solutionText += `- ${topicMetadata[topic].title}: use get-documentation with topic "${topic}"\n`;
    		});
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: solutionText,
    				},
    			],
    		};
    	}
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/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 of behavioral disclosure. It states the tool 'Get[s] help' but doesn't explain what form this help takes (e.g., troubleshooting steps, error resolution, documentation links), whether it requires authentication, rate limits, or any side effects. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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

Conciseness5/5

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

The description is a single, efficient sentence: 'Get help with common PaymanAI integration issues'. It is front-loaded with the core purpose and contains no unnecessary words or redundant information, making it highly concise and well-structured.

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

Completeness2/5

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

Given the tool's complexity (2 parameters, no output schema, no annotations), the description is incomplete. It lacks details on what the tool returns (e.g., help text, links, steps), behavioral aspects like error handling or prerequisites, and differentiation from siblings. Without annotations or output schema, the description should provide more context to fully inform usage.

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?

The input schema has 100% description coverage, with clear descriptions for both parameters: 'problem' ('Describe the issue you're experiencing') and 'sdk' ('Which SDK you're using'). The description doesn't add any additional meaning beyond what the schema provides, such as examples or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the schema adequately documents the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Get help with common PaymanAI integration issues'. It specifies the action ('Get help') and the resource ('common PaymanAI integration issues'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get-sdk-help' or 'search-documentation', which might offer similar assistance.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions 'common PaymanAI integration issues' but doesn't specify what qualifies as 'common' or when to choose this over sibling tools such as 'get-sdk-help' or 'search-documentation'. There are no explicit when/when-not statements or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.