Skip to main content
Glama
sai4447

agentfuse-mcp

by sai4447

get_affiliate_program

Retrieve complete details of an affiliate program using its slug. Obtain UUID, commission structure, payout terms, description, and network information.

Instructions

Get full details for a single affiliate program by its slug. Returns the program's UUID (needed for generate_tracked_link), commission structure, payout terms, description, and network info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe program slug (e.g. 'webflow', 'elevenlabs', 'notion', 'zapier'). Use list_affiliate_programs to discover available slugs.

Implementation Reference

  • Handler function for get_affiliate_program. Validates slug parameter is present, then calls agentfuse helper to GET /api/catalog/{slug}. Returns full program details including UUID, commission structure, payout terms, description, and network info.
    async function handleGetAffiliateProgram(args) {
      if (!args.slug) {
        throw new McpError(ErrorCode.InvalidParams, "slug is required");
      }
      return agentfuse("GET", `/api/catalog/${encodeURIComponent(args.slug)}`);
    }
  • Schema definition for get_affiliate_program tool. Defines input as an object with a required 'slug' string property. Description explains it returns program UUID, commission structure, payout terms, description, and network info.
    {
      name: "get_affiliate_program",
      description:
        "Get full details for a single affiliate program by its slug. " +
        "Returns the program's UUID (needed for generate_tracked_link), commission structure, " +
        "payout terms, description, and network info.",
      inputSchema: {
        type: "object",
        properties: {
          slug: {
            type: "string",
            description:
              "The program slug (e.g. 'webflow', 'elevenlabs', 'notion', 'zapier'). " +
              "Use list_affiliate_programs to discover available slugs.",
          },
        },
        required: ["slug"],
      },
    },
  • src/index.js:448-448 (registration)
    Registration/dispatch map entry mapping the tool name 'get_affiliate_program' to its handler function handleGetAffiliateProgram.
    get_affiliate_program:   handleGetAffiliateProgram,
  • Helper function 'agentfuse' used by the handler to make REST API calls to AgentFuse. Handles auth, request formatting, error parsing, and JSON responses.
    export async function agentfuse(method, path, body = null) {
      const apiKey = process.env.AGENTFUSE_API_KEY || "";
      const baseUrl = (process.env.AGENTFUSE_API_URL || "https://api.agentfuse.io").replace(/\/$/, "");
    
      if (!apiKey) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          "AGENTFUSE_API_KEY environment variable is not set. " +
            "Get a key at https://agentfuse.io and add it to your MCP config."
        );
      }
    
      const url = `${baseUrl}${path}`;
      const headers = {
        Authorization: `Bearer ${apiKey}`,
        "Content-Type": "application/json",
        "User-Agent": "agentfuse-mcp/1.1.2",
      };
    
      const options = { method, headers };
      if (body !== null) {
        options.body = JSON.stringify(body);
      }
    
      const res = await fetch(url, options);
      const text = await res.text();
    
      let data;
      try {
        data = JSON.parse(text);
      } catch {
        throw new McpError(
          ErrorCode.InternalError,
          `AgentFuse API returned non-JSON response (status ${res.status}): ${text.slice(0, 200)}`
        );
      }
    
      if (!res.ok) {
        const msg = data?.error || data?.message || JSON.stringify(data);
        throw new McpError(
          ErrorCode.InternalError,
          `AgentFuse API error ${res.status}: ${msg}`
        );
      }
    
      return data;
    }
Behavior4/5

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

With no annotations, the description adequately conveys this is a read-only lookup (no mention of side effects). It explains the output includes commission structure, payout terms, etc. The description is transparent about what the tool does, though it could mention if there are any rate limits or authentication requirements, but for a simple read operation this is sufficient.

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?

Two concise sentences with front-loaded key information. Every sentence adds value with no redundancy.

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

Completeness5/5

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

For a simple tool with one parameter and no output schema, the description fully explains the purpose, parameter, return contents, and links to related tools. Nothing is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage and the description adds meaningful context: it gives example slugs ('webflow', 'elevenlabs') and tells the user to use list_affiliate_programs to find more slugs. This goes beyond the schema alone.

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

Purpose5/5

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

The description clearly states it retrieves full details for a single affiliate program by slug. It lists specific return fields (UUID, commission, payout terms, etc.) and distinguishes from sibling tools like list_affiliate_programs (listing all) and generate_tracked_link (which requires the UUID from this tool).

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

Usage Guidelines4/5

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

The description explicitly notes that the slug parameter can be discovered using list_affiliate_programs, and that the returned UUID is needed for generate_tracked_link. While it doesn't state explicit when-not-to-use scenarios, the context is clear and provides helpful direction.

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/sai4447/agentfuse-mcp'

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