Skip to main content
Glama

adjust-standard-report

Generate standard Adjust reports for mobile analytics with common metrics like performance, retention, cohort, and revenue data.

Instructions

Get a standard Adjust report with common metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_tokensNoComma-separated list of app tokens to include
date_rangeNoDate range (e.g., 2023-01-01:2023-01-31, yesterday, last_7_days, this_month)last_7_days
report_typeNoType of standard report to generateperformance

Implementation Reference

  • The main handler function for the 'adjust-standard-report' tool. It selects predefined metrics and dimensions based on the report_type parameter, constructs the query for the Adjust API, fetches the report data using AdjustApiClient.fetchReports, generates a markdown report using analyzeReportData, and handles errors.
    }, async (params, extra) => {
      try {
        // Set up metrics and dimensions based on report type
        let metrics: string[] = [];
        let dimensions: string[] = [];
    
        switch (params.report_type) {
          case "performance":
            metrics = ["installs", "clicks", "impressions", "network_cost", "network_ecpi", "sessions"];
            dimensions = ["app", "partner_name", "campaign", "day"];
            break;
          case "retention":
            metrics = ["installs", "retention_rate_d1", "retention_rate_d7", "retention_rate_d30"];
            dimensions = ["app", "partner_name", "campaign", "day"];
            break;
          case "cohort":
            metrics = ["installs", "sessions_per_user", "revenue_per_user"];
            dimensions = ["app", "partner_name", "campaign", "cohort"];
            break;
          case "revenue":
            metrics = ["installs", "revenue", "arpu", "arpdau"];
            dimensions = ["app", "partner_name", "campaign", "day"];
            break;
        }
    
        // Build query parameters
        const queryParams: Record<string, any> = {
          date_period: params.date_range,
          metrics: metrics.join(','),
          dimensions: dimensions.join(','),
          ad_spend_mode: "network"
        };
    
        // Handle app tokens
        if (params.app_tokens) {
          queryParams.app_token__in = params.app_tokens;
        }
    
        // Fetch data from Adjust
        const reportData = await client.fetchReports(params.date_range, queryParams);
    
        // Generate a report title based on the type
        const reportTitle = `## Adjust ${params.report_type.charAt(0).toUpperCase() + params.report_type.slice(1)} Report`;
        const dateRangeInfo = `### Date Range: ${params.date_range}`;
    
        // Analyze the data
        const analysis = analyzeReportData(reportData);
    
        return {
          isError: false,
          content: [
            {
              type: "text" as const,
              text: `${reportTitle}\n${dateRangeInfo}\n\n${analysis}\n\n\`\`\`json\n${JSON.stringify(reportData, null, 2)}\n\`\`\``,
            }
          ],
        };
      } catch (error) {
        console.error("Error fetching standard Adjust report:", error);
    
        // Extract status code and message (same error handling as before)
        let statusCode = 500;
        let errorMessage = "Unknown error";
    
        if (error instanceof Error) {
          errorMessage = error.message;
    
          if ('response' in error && error.response && typeof error.response === 'object') {
            const axiosError = error as any;
            statusCode = axiosError.response.status;
    
            // Provide helpful messages based on status code
            switch (statusCode) {
              case 400:
                errorMessage = "Bad request: Your query contains invalid parameters or is malformed.";
                break;
              case 401:
                errorMessage = "Unauthorized: Please check your API credentials.";
                break;
              case 403:
                errorMessage = "Forbidden: You don't have permission to access this data.";
                break;
              case 429:
                errorMessage = "Too many requests: You've exceeded the rate limit.";
                break;
              case 503:
                errorMessage = "Service unavailable: The Adjust API is currently unavailable.";
                break;
              case 504:
                errorMessage = "Gateway timeout: The query took too long to process.";
                break;
              default:
                errorMessage = axiosError.response.data?.message || errorMessage;
            }
          }
        }
    
        return {
          isError: true,
          content: [
            {
              type: "text" as const,
              text: `## Error Fetching Adjust Standard Report\n\n**Status Code**: ${statusCode}\n\n**Error**: ${errorMessage}\n\nPlease check your parameters and try again.`,
            },
          ],
        };
      }
  • Zod schema defining the input parameters for the tool: app_tokens (comma-separated list), date_range (e.g., last_7_days), report_type (performance, retention, cohort, revenue with default 'performance').
    server.tool("adjust-standard-report", "Get a standard Adjust report with common metrics", {
      app_tokens: z.string()
        .describe("Comma-separated list of app tokens to include")
        .default(""),
      date_range: z.string()
        .describe("Date range (e.g., 2023-01-01:2023-01-31, yesterday, last_7_days, this_month)")
        .default("last_7_days"),
      report_type: z.enum(["performance", "retention", "cohort", "revenue"])
        .describe("Type of standard report to generate")
        .default("performance"),
    }, async (params, extra) => {
  • Registration of the 'adjust-standard-report' tool on the MCP server.
    server.tool("adjust-standard-report", "Get a standard Adjust report with common metrics", {
  • Helper function used by the tool handler to analyze and format the raw report data into a human-readable markdown summary with totals, breakdowns, and warnings.
    function analyzeReportData(data: any) {
      let analysis = "";
    
      if (!data || !data.rows || data.rows.length === 0) {
        return "No data available for analysis.";
      }
    
      // Add totals summary
      if (data.totals) {
        analysis += "## Summary\n";
        Object.entries(data.totals).forEach(([metric, value]) => {
          analysis += `**Total ${metric}**: ${value}\n`;
        });
        analysis += "\n";
      }
    
      // Add row analysis
      analysis += "## Breakdown\n";
    
      // Get all metrics (non-dimension fields) from the first row
      const firstRow = data.rows[0];
      const metrics = Object.keys(firstRow).filter(key =>
        !['attr_dependency', 'app', 'partner_name', 'campaign', 'campaign_id_network',
          'campaign_network', 'adgroup', 'creative', 'country', 'os_name', 'day', 'week',
          'month', 'year'].includes(key)
      );
    
      // Analyze each row
      data.rows.forEach((row: any, index: number) => {
        // Create a title for this row based on available dimensions
        let rowTitle = "";
        if (row.campaign) rowTitle += `Campaign: ${row.campaign} `;
        if (row.partner_name) rowTitle += `(${row.partner_name}) `;
        if (row.app) rowTitle += `- App: ${row.app} `;
        if (row.country) rowTitle += `- Country: ${row.country} `;
        if (row.os_name) rowTitle += `- OS: ${row.os_name} `;
    
        analysis += `### ${rowTitle || `Row ${index + 1}`}\n`;
    
        // Add metrics for this row
        metrics.forEach(metric => {
          if (row[metric] !== undefined) {
            analysis += `**${metric}**: ${row[metric]}\n`;
          }
        });
        analysis += "\n";
      });
    
      // Add warnings if any
      if (data.warnings && data.warnings.length > 0) {
        analysis += "## Warnings\n";
        data.warnings.forEach((warning: string) => {
          analysis += `- ${warning}\n`;
        });
      }
    
      return analysis;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Get' which implies a read operation, but doesn't specify permissions, rate limits, data format, or any side effects. This is a significant gap for a tool with no annotation coverage.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, making it easy for an agent to parse 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 the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like authentication needs, error handling, or return format, which are crucial for a reporting tool. The high schema coverage doesn't compensate for these gaps in context.

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?

The schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no additional semantic context beyond what's in the schema, such as explaining interactions between parameters or usage examples, meeting the baseline for high schema coverage.

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 ('a standard Adjust report with common metrics'), making the purpose understandable. However, it doesn't explicitly differentiate from the sibling tool 'adjust-reporting', which appears to be a similar reporting tool, so it doesn't reach the highest score.

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, such as the sibling 'adjust-reporting'. There's no mention of prerequisites, constraints, or specific contexts for usage, leaving the agent with minimal 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/bitscorp-mcp/mcp-adjust'

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