Skip to main content
Glama
sai4447

agentfuse-mcp

by sai4447

list_tracked_links

Retrieve previously generated affiliate links with their tracking details, click counts, and program info to review existing links before creating new ones or display active referral links for a user.

Instructions

List tracked affiliate links previously generated by this API key. Returns each link's tracked URL, tracking_code, click count, program, and end user. Use this to look up existing links before generating a new one, or to show a user their active referral links.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_user_idNoFilter links by end user ID. Use this to fetch all links for a specific user.
program_slugNoFilter links by program slug (e.g. 'webflow'). The tool resolves the slug to a UUID automatically before querying.
limitNoNumber of links to return (default: 20, max: 100).
cursorNoPagination cursor from a previous call to get the next page.

Implementation Reference

  • Handler function for list_tracked_links tool. Builds query params from args (end_user_id, limit, cursor) and optionally resolves program_slug to a UUID via the catalog API before making a GET request to /api/links.
    async function handleListTrackedLinks(args) {
      const params = new URLSearchParams();
      if (args.end_user_id) params.set("end_user_id", args.end_user_id);
      if (args.limit)       params.set("limit", String(args.limit));
      if (args.cursor)      params.set("cursor", args.cursor);
    
      // Optional: resolve program_slug -> program_id UUID for filtering
      if (args.program_slug) {
        const catalogData = await agentfuse("GET", `/api/catalog/${encodeURIComponent(args.program_slug)}`);
        const program_id = catalogData?.data?.id;
        if (!program_id) {
          throw new McpError(
            ErrorCode.InvalidParams,
            `Program not found for slug "${args.program_slug}". Use list_affiliate_programs to check available slugs.`
          );
        }
        params.set("program_id", program_id);
      }
    
      const qs = params.toString();
      return agentfuse("GET", `/api/links${qs ? "?" + qs : ""}`);
    }
  • Schema/definition for list_tracked_links tool. All properties (end_user_id, program_slug, limit, cursor) are optional.
    {
      name: "list_tracked_links",
      description:
        "List tracked affiliate links previously generated by this API key. " +
        "Returns each link's tracked URL, tracking_code, click count, program, and end user. " +
        "Use this to look up existing links before generating a new one, or to show a user " +
        "their active referral links.",
      inputSchema: {
        type: "object",
        properties: {
          end_user_id: {
            type: "string",
            description:
              "Filter links by end user ID. Use this to fetch all links for a specific user.",
          },
          program_slug: {
            type: "string",
            description:
              "Filter links by program slug (e.g. 'webflow'). " +
              "The tool resolves the slug to a UUID automatically before querying.",
          },
          limit: {
            type: "number",
            description: "Number of links to return (default: 20, max: 100).",
            minimum: 1,
            maximum: 100,
          },
          cursor: {
            type: "string",
            description: "Pagination cursor from a previous call to get the next page.",
          },
        },
        required: [],
      },
  • src/index.js:446-454 (registration)
    Registration in the HANDLERS dispatch map that maps tool name 'list_tracked_links' to its handler function.
    export const HANDLERS = {
      list_affiliate_programs: handleListAffiliatePrograms,
      get_affiliate_program:   handleGetAffiliateProgram,
      generate_tracked_link:   handleGenerateTrackedLink,
      list_tracked_links:      handleListTrackedLinks,
      get_stats:               handleGetStats,
      record_signup:           handleRecordSignup,
      record_commission:       handleRecordCommission,
    };
Behavior3/5

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

No annotations exist, so the description carries full burden. It discloses return fields but does not explicitly state read-only nature, authorization needs, or potential side effects. The word 'list' implies read, but not confirmed.

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 sentences with no fluff: first defines purpose and output, second gives usage guidance. Every sentence earns its place.

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

Completeness4/5

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

For a list tool with good schema and no output schema, the description adequately covers purpose, return fields, and usage context. Could mention pagination behavior explicitly but schema covers cursor param.

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 coverage is 100% with detailed parameter descriptions. The description adds no new parameter-level information beyond restating usage context, which does not exceed the baseline for high coverage.

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 lists tracked affiliate links previously generated by this API key, with specific fields returned. It distinguishes from sibling tools like generate_tracked_link (creation) and list_affiliate_programs (programs).

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 tells when to use: 'to look up existing links before generating a new one, or to show a user their active referral links.' It does not explicitly exclude alternatives but provides clear context.

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