Skip to main content
Glama
ysntony

AppsFlyer MCP Server

by ysntony

get_aggregate_data

Fetch aggregate analytics reports from AppsFlyer for specified date ranges and report types to analyze app performance data.

Instructions

Fetches aggregate data reports from the AppsFlyer Pull API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes

Implementation Reference

  • The main execution logic for the get_aggregate_data tool. Decorated with @mcp.tool() for automatic registration and handling of the tool call. Fetches CSV aggregate reports from AppsFlyer API using provided parameters.
    @mcp.tool()
    async def get_aggregate_data(data: AggregateDataInput):
        """Fetches aggregate data reports from the AppsFlyer Pull API."""
        if not AF_API_BASE_URL or not AF_TOKEN:
            return "Error: AppsFlyer API credentials not configured."
    
        # The specific endpoint for the AGGREGATE PULL API
        endpoint = f"{AF_API_BASE_URL}/api/agg-data/export/app/{data.app_id}/{data.report_type}/v5"
    
        params = {
            "from": data.from_date.isoformat(),
            "to": data.to_date.isoformat(),
        }
    
        headers = {
            "Authorization": f"Bearer {AF_TOKEN}",
            "Accept": "text/csv"
        }
    
        try:
            async with httpx.AsyncClient(timeout=30.0) as client:
                response = await client.get(endpoint, headers=headers, params=params)
                response.raise_for_status()
    
                return response.text
    
        except httpx.HTTPStatusError as e:
            return f"HTTP error occurred: {e.response.text}"
        except httpx.RequestError as e:
            return f"A network error occurred: {e}"
  • Pydantic input model (schema) for validating parameters to the get_aggregate_data tool.
    class AggregateDataInput(BaseModel):
        app_id: str = Field(..., description="The ID of the AppsFlyer app.")
        from_date: date = Field(..., description="The start date of the data range (YYYY-MM-DD).")
        to_date: date = Field(..., description="The end date of the data range (YYYY-MM-DD).")
        report_type: Literal[
            "partners_report",
            "partners_by_date_report", 
            "daily_report",
            "geo_report",
            "geo_by_date_report"
        ] = Field("daily_report", description="The type of aggregate report to fetch.")
  • The @mcp.tool() decorator registers the get_aggregate_data function as an MCP tool on the FastMCP server instance.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'fetches aggregate data reports' which implies a read-only operation, but doesn't mention authentication requirements, rate limits, data format, pagination, or error handling. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 function without unnecessary words. It's appropriately sized and front-loaded with the core action, making it easy 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 tool's complexity (fetching data from an external API with multiple report types), lack of annotations, no output schema, and poor parameter documentation, the description is insufficient. It doesn't explain what 'aggregate data reports' contain, how they're structured, or provide any context about the AppsFlyer API integration.

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

Parameters1/5

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

The description provides no information about parameters, while the schema has 0% description coverage (the schema's internal descriptions don't count toward this metric). With 1 required parameter (a nested object with 4 sub-parameters) and no parameter details in the description, it fails to compensate for the schema's lack of documentation.

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 ('fetches') and resource ('aggregate data reports from the AppsFlyer Pull API'), providing a specific purpose. However, it doesn't differentiate from the only sibling tool 'test_appsflyer_connection', which appears to be a connection test rather than a data retrieval tool, so the distinction isn't explicitly made.

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 or any context for its application. It mentions the source ('AppsFlyer Pull API') but doesn't specify scenarios, prerequisites, or exclusions, leaving usage entirely implicit.

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/ysntony/appsflyer-mcp'

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