Skip to main content
Glama
sai4447

agentfuse-mcp

by sai4447

get_stats

Retrieve AgentFuse dashboard summary stats including total clicks, signups, commissions, and top-performing programs for reporting revenue data.

Instructions

Retrieve AgentFuse dashboard summary stats: total clicks, signups, commissions, and top-performing programs. Useful for reporting to users or surfacing revenue data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_stats' tool. It calls agentfuse('GET', '/api/stats') to retrieve dashboard summary stats (total clicks, signups, commissions, top-performing programs).
    async function handleGetStats() {
      return agentfuse("GET", "/api/stats");
    }
  • The tool definition and input schema for 'get_stats'. No input parameters are required — the tool takes an empty object.
    {
      name: "get_stats",
      description:
        "Retrieve AgentFuse dashboard summary stats: total clicks, signups, commissions, " +
        "and top-performing programs. Useful for reporting to users or surfacing revenue data.",
      inputSchema: {
        type: "object",
        properties: {},
        required: [],
      },
    },
  • src/index.js:446-454 (registration)
    The HANDLERS dispatch map that maps the tool name 'get_stats' to its handler function 'handleGetStats'.
    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,
    };
  • The 'agentfuse' helper function used by handleGetStats to make HTTP requests to the AgentFuse REST API.
    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;
    }
Behavior3/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves stats but does not disclose behavioral traits such as data freshness, caching, or whether it requires specific permissions. The simplicity of a zero-parameter tool partially mitigates this.

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 sentence that is concise and front-loaded with the tool's purpose. Every word adds value.

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?

Given zero parameters and no output schema, the description is fairly complete. It specifies what stats are retrieved and a use case. It could mention if the stats are aggregate over all time or filtered, but not necessary for a simple endpoint.

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

Parameters4/5

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

The input schema has no parameters, and schema description coverage is 100%. Baseline for zero parameters is 4, and the description adds no extra parameter info (none needed).

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 dashboard summary stats and lists specific metrics (total clicks, signups, commissions, top-performing programs). It distinguishes from sibling tools like generate_tracked_link or record_commission, which focus on individual operations.

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 mentions it is useful for reporting to users or surfacing revenue data, providing clear context. However, it does not explicitly exclude cases where other tools like list_affiliate_programs might be more appropriate.

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