Skip to main content
Glama
PaymanAI

Payman Documentation MCP Server

Official
by PaymanAI

get-sdk-help

Resolve Node.js or Python SDK queries by specifying the SDK and feature or class needing assistance. Enhance integration development with targeted documentation support.

Instructions

Get help with Node.js or Python SDK usage

Input Schema

NameRequiredDescriptionDefault
featureYesWhich SDK feature or class you need help with
sdkYesWhich SDK you need help with

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "feature": { "description": "Which SDK feature or class you need help with", "type": "string" }, "sdk": { "description": "Which SDK you need help with", "enum": [ "nodejs", "python" ], "type": "string" } }, "required": [ "sdk", "feature" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'get-sdk-help' tool. It searches SDK documentation topics for relevant content matching the specified SDK (nodejs or python) and feature, extracts relevant sections, ranks by relevance, and compiles a markdown response with help text and links to full docs.
    async ({ sdk, feature }) => { log(`Getting help for ${sdk} SDK feature: ${feature}`); const sdkTopics = [ "setup-and-installation", "create-payees", "send-payments", "create-payee", "search-payees", "check-balances", ]; const helpPromises = sdkTopics.map(async (topic) => { const content = await fetchDocMarkdown(pathMap[topic]); const sdkIdentifier = sdk === "nodejs" ? ["node", "nodejs", "javascript", "js"] : ["python", "py"]; const relevance = sdkIdentifier.some( (id) => content.toLowerCase().includes(id) && content.toLowerCase().includes(feature.toLowerCase()) && Math.abs( content.toLowerCase().indexOf(id) - content.toLowerCase().indexOf(feature.toLowerCase()) ) < 500 ); if (!relevance) return null; const lines = content.split("\n"); const featureIndex = lines.findIndex((line) => line.toLowerCase().includes(feature.toLowerCase()) ); if (featureIndex === -1) return null; let headingIndex = featureIndex; while (headingIndex > 0 && !lines[headingIndex].startsWith("#")) { headingIndex--; } const sectionHeading = lines[headingIndex]; const sectionContent = lines .slice(headingIndex, featureIndex + 20) .join("\n"); return { topic, heading: sectionHeading, content: sectionContent, relevance: (content.toLowerCase().includes(sdk) ? 2 : 1) + (sectionContent .toLowerCase() .includes(feature.toLowerCase()) ? 3 : 0), }; }); const helpResults = (await Promise.all(helpPromises)).filter(Boolean); helpResults.sort((a, b) => (b?.relevance || 0) - (a?.relevance || 0)); if (helpResults.length === 0) { return { content: [ { type: "text", text: `No specific help found for ${feature} in the ${sdk} SDK. Try checking the full SDK documentation with get-documentation or using more generic terms.`, }, ], }; } let helpText = `# ${sdk.toUpperCase()} SDK Help: ${feature}\n\n`; helpResults.forEach((result) => { if (!result) return; helpText += `## From ${topicMetadata[result.topic].title}\n\n`; helpText += `${result.content}\n\n`; helpText += `*For complete documentation, use get-documentation with topic "${result.topic}"*\n\n---\n\n`; }); helpText += `## Additional Resources\n\n`; helpText += `- Setup and Installation: use get-documentation with topic "setup-and-installation"\n`; helpText += `- Error Handling: use get-documentation with topic "error-handling"\n`; helpText += `- For code examples, try the get-code-examples tool with feature="${feature}" and language="${sdk}"\n`; return { content: [ { type: "text", text: helpText, }, ], }; }
  • Zod schema defining input parameters: 'sdk' as enum ['nodejs', 'python'] and 'feature' as string.
    { sdk: z .enum(["nodejs", "python"]) .describe("Which SDK you need help with"), feature: z .string() .describe("Which SDK feature or class you need help with"),
  • src/index.ts:515-627 (registration)
    Registration of the 'get-sdk-help' tool on the MCP server, specifying name, description, input schema, and handler.
    server.tool( "get-sdk-help", "Get help with Node.js or Python SDK usage", { sdk: z .enum(["nodejs", "python"]) .describe("Which SDK you need help with"), feature: z .string() .describe("Which SDK feature or class you need help with"), }, async ({ sdk, feature }) => { log(`Getting help for ${sdk} SDK feature: ${feature}`); const sdkTopics = [ "setup-and-installation", "create-payees", "send-payments", "create-payee", "search-payees", "check-balances", ]; const helpPromises = sdkTopics.map(async (topic) => { const content = await fetchDocMarkdown(pathMap[topic]); const sdkIdentifier = sdk === "nodejs" ? ["node", "nodejs", "javascript", "js"] : ["python", "py"]; const relevance = sdkIdentifier.some( (id) => content.toLowerCase().includes(id) && content.toLowerCase().includes(feature.toLowerCase()) && Math.abs( content.toLowerCase().indexOf(id) - content.toLowerCase().indexOf(feature.toLowerCase()) ) < 500 ); if (!relevance) return null; const lines = content.split("\n"); const featureIndex = lines.findIndex((line) => line.toLowerCase().includes(feature.toLowerCase()) ); if (featureIndex === -1) return null; let headingIndex = featureIndex; while (headingIndex > 0 && !lines[headingIndex].startsWith("#")) { headingIndex--; } const sectionHeading = lines[headingIndex]; const sectionContent = lines .slice(headingIndex, featureIndex + 20) .join("\n"); return { topic, heading: sectionHeading, content: sectionContent, relevance: (content.toLowerCase().includes(sdk) ? 2 : 1) + (sectionContent .toLowerCase() .includes(feature.toLowerCase()) ? 3 : 0), }; }); const helpResults = (await Promise.all(helpPromises)).filter(Boolean); helpResults.sort((a, b) => (b?.relevance || 0) - (a?.relevance || 0)); if (helpResults.length === 0) { return { content: [ { type: "text", text: `No specific help found for ${feature} in the ${sdk} SDK. Try checking the full SDK documentation with get-documentation or using more generic terms.`, }, ], }; } let helpText = `# ${sdk.toUpperCase()} SDK Help: ${feature}\n\n`; helpResults.forEach((result) => { if (!result) return; helpText += `## From ${topicMetadata[result.topic].title}\n\n`; helpText += `${result.content}\n\n`; helpText += `*For complete documentation, use get-documentation with topic "${result.topic}"*\n\n---\n\n`; }); helpText += `## Additional Resources\n\n`; helpText += `- Setup and Installation: use get-documentation with topic "setup-and-installation"\n`; helpText += `- Error Handling: use get-documentation with topic "error-handling"\n`; helpText += `- For code examples, try the get-code-examples tool with feature="${feature}" and language="${sdk}"\n`; return { content: [ { type: "text", text: helpText, }, ], }; } );

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/PaymanAI/payman-doc-mcp-server'

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