get_program_details
Retrieve comprehensive affiliate program details including commission rates, conversion statistics, and merchant data. Evaluate partnership potential by analyzing attribution windows, product catalogs, and performance metrics to make informed promotion decisions.
Instructions
Get comprehensive details for a specific affiliate program. Returns commission rates (percentage or flat), attribution window, auto-approval status, merchant info, conversion stats (total conversions, average order value, total revenue), product catalog with per-product commission rates, and anonymized top performer data. Use this after search_programs to evaluate whether a program is worth promoting. The program ID comes from search_programs or list_merchant_programs results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| program_id | Yes | The program ID to look up (from search_programs or list_merchant_programs). |
Implementation Reference
- mcp/src/tools/details.ts:37-49 (handler)The actual handler function that executes get_program_details logic. Validates program_id input and makes API call to fetch program details.
export async function runGetProgramDetails( config: ApiConfig, input: Record<string, unknown>, ): Promise<unknown> { const programId = input['program_id']; if (typeof programId !== 'string' || programId.trim().length === 0) { throw new Error('program_id is required and must be a non-empty string'); } return apiFetch(config, `/programs/${encodeURIComponent(programId)}/details`, { authType: 'none', }); } - mcp/src/tools/details.ts:15-35 (schema)Tool definition including name, description, and inputSchema with program_id parameter validation.
export const getProgramDetailsTool: Tool = { name: 'get_program_details', description: 'Get comprehensive details for a specific affiliate program. Returns commission ' + 'rates (percentage or flat), attribution window, auto-approval status, merchant info, ' + 'conversion stats (total conversions, average order value, total revenue), product ' + 'catalog with per-product commission rates, and anonymized top performer data. ' + 'Use this after search_programs to evaluate whether a program is worth promoting. ' + 'The program ID comes from search_programs or list_merchant_programs results.', inputSchema: { type: 'object' as const, properties: { program_id: { type: 'string', description: 'The program ID to look up (from search_programs or list_merchant_programs).', minLength: 1, }, }, required: ['program_id'], }, }; - mcp/src/server.ts:122-124 (registration)Tool dispatch case in the server's request handler switch statement that routes calls to runGetProgramDetails.
case 'get_program_details': result = await runGetProgramDetails(cfg, input); break; - mcp/src/server.ts:56-66 (registration)Import statement and ALL_TOOLS array registration where getProgramDetailsTool is added to the available tools list.
import { getProgramDetailsTool, runGetProgramDetails } from './tools/details.js'; const ALL_TOOLS = [ trackAgentConversionTool, verifyAttributionTokenTool, getCommissionStatusTool, runPayoutCycleTool, listMerchantProgramsTool, searchProgramsTool, getProgramDetailsTool, ];