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

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'Get help' but doesn't describe what form this help takes (e.g., textual advice, code snippets, links), whether it requires authentication, any rate limits, or potential 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.

Conciseness4/5

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

The description is a single, clear sentence that efficiently states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool, though it could be more front-loaded with specific details about the type of help provided. There's no wasted text, making it concise.

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 doesn't explain what the tool returns (e.g., help text, solutions, error codes), how to interpret results, or any behavioral nuances. For a tool that likely provides varied output based on input, more context is needed to guide effective use.

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 both parameters ('problem' and 'sdk') with descriptions and enum values. The description doesn't add any meaning beyond what the schema provides, such as examples of problem descriptions or guidance on SDK selection. However, with high schema coverage, a baseline score of 3 is appropriate as the description doesn't need to compensate.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get help with common PaymanAI integration issues' which provides a general purpose (assistance with integration problems) but is vague about what specific help it provides. It doesn't specify whether it returns solutions, troubleshooting steps, or diagnostic information, nor does it clearly distinguish 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 like 'get-sdk-help' or 'search-documentation'. It mentions 'common PaymanAI integration issues' which implies a context but doesn't specify prerequisites, exclusions, or when other tools might be more appropriate. The agent must infer usage from the tool name and description alone.

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/Vanshika-Rana/payman-mcp-server'

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