Skip to main content
Glama
PaymanAI

Payman Documentation MCP Server

Official
by PaymanAI

get-documentation

Retrieve PaymanAI documentation on specific topics like API reference, setup, or error handling to streamline developer integrations and workflows.

Instructions

Get PaymanAI documentation on a specific topic

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesThe documentation topic to retrieve

Implementation Reference

  • Handler function that retrieves documentation for the specified topic by fetching Markdown content from a mapped path, caching it, and appending related topics information.
    async ({ topic }) => {
    	const path = pathMap[topic];
    	log(`Getting doc for topic: ${topic}, path: ${path}`);
    	const docContent = await fetchDocMarkdown(path);
    
    	const relatedTopics = topicMetadata[topic].relatedTopics;
    	const relatedTopicsText =
    		relatedTopics.length > 0
    			? `\n\n## Related Topics\n\n${relatedTopics
    					.map(
    						(t) =>
    							`- ${topicMetadata[t].title} (use get-documentation with topic "${t}")`
    					)
    					.join("\n")}`
    			: "";
    
    	return {
    		content: [
    			{
    				type: "text",
    				text: docContent + relatedTopicsText,
    			},
    		],
    	};
    }
  • Input schema for the tool, defining the 'topic' parameter as a Zod enum based on predefined docTopics.
    {
    	topic: z
    		.enum(docTopics)
    		.describe("The documentation topic to retrieve"),
    },
  • src/index.ts:136-169 (registration)
    Registration of the 'get-documentation' tool on the MCP server, including name, description, input schema, and handler function.
    server.tool(
    	"get-documentation",
    	"Get PaymanAI documentation on a specific topic",
    	{
    		topic: z
    			.enum(docTopics)
    			.describe("The documentation topic to retrieve"),
    	},
    	async ({ topic }) => {
    		const path = pathMap[topic];
    		log(`Getting doc for topic: ${topic}, path: ${path}`);
    		const docContent = await fetchDocMarkdown(path);
    
    		const relatedTopics = topicMetadata[topic].relatedTopics;
    		const relatedTopicsText =
    			relatedTopics.length > 0
    				? `\n\n## Related Topics\n\n${relatedTopics
    						.map(
    							(t) =>
    								`- ${topicMetadata[t].title} (use get-documentation with topic "${t}")`
    						)
    						.join("\n")}`
    				: "";
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: docContent + relatedTopicsText,
    				},
    			],
    		};
    	}
    );
  • Helper function to fetch and cache Markdown documentation from PaymanAI docs site.
    async function fetchDocMarkdown(path: string): Promise<string> {
    	const now = Date.now();
    	const cachedDoc = documentCache.get(path);
    
    	if (cachedDoc && now - cachedDoc.timestamp < CACHE_TTL) {
    		log(`Using cached content for: ${path}`);
    		return cachedDoc.content;
    	}
    
    	try {
    		const url = `https://docs.paymanai.com${path}.md`;
    		log(`Fetching: ${url}`);
    
    		const response = await fetch(url);
    
    		if (!response.ok) {
    			throw new Error(`Failed to fetch: ${response.status}`);
    		}
    
    		const content = await response.text();
    		documentCache.set(path, { content, timestamp: now });
    
    		return content;
    	} catch (error) {
    		log(`Error fetching documentation: ${error}`);
    		return `Documentation content not available for path: ${path}.md\nError: ${
    			error instanceof Error ? error.message : String(error)
    		}`;
    	}
    }
  • Mapping of topics to their corresponding documentation path suffixes used in the handler.
    const pathMap: Record<string, string> = {
    	quickstart: "/overview/quickstart",
    	playground: "/overview/playground",
    	"setup-and-installation": "/sdks/setup-and-installation",
    	"create-payees": "/sdks/create-payees",
    	"send-payments": "/sdks/send-payments",
    	"create-payee": "/sdks/create-payee",
    	"search-payees": "/sdks/search-payees",
    	"check-balances": "/sdks/check-balances",
    	"bill-payment-agent": "/guides/bill-payment-agent",
    	"api-reference": "/api-reference/introduction",
    	"api-keys": "/api-reference/get-api-key",
    	"error-handling": "/api-reference/error-handling",
    };
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 what the tool does but lacks critical details: it doesn't specify if this is a read-only operation, what format the documentation is returned in (e.g., text, HTML, markdown), whether there are rate limits, or if authentication is required. For a tool with no annotation coverage, this is a significant gap in transparency.

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 that front-loads the core purpose without any wasted words. It's appropriately sized for a simple tool with one parameter, making it easy to parse and understand quickly.

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 no annotations and no output schema, the description is incomplete for a documentation retrieval tool. It doesn't explain what is returned (e.g., content format, structure, or errors), lacks behavioral context like read-only nature or authentication needs, and doesn't differentiate from siblings. For a tool with 100% schema coverage but missing output and annotation context, it should provide more usage and behavioral details.

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%, with the single parameter 'topic' fully documented in the schema including an enum list. The description adds no additional parameter semantics beyond implying retrieval based on a topic, which is already covered by the schema. This meets the baseline of 3 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.

Purpose4/5

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

The description clearly states the action ('Get') and resource ('PaymanAI documentation on a specific topic'), making the purpose immediately understandable. It distinguishes from siblings like 'search-documentation' by specifying retrieval of documentation rather than searching, though it doesn't explicitly contrast with 'get-code-examples' or 'get-sdk-help' which might overlap in retrieving documentation-related content.

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. With siblings like 'search-documentation' and 'get-code-examples', it's unclear if this tool is for structured topic retrieval while others handle queries or examples. No exclusions or prerequisites are mentioned, leaving usage context ambiguous.

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

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