Skip to main content
Glama
adrielisa

MCP Server: Weather & Upnify Integration

by adrielisa

get-upnify-activity-report

Generate Upnify activity reports by group or executive for specific periods, enabling detailed tracking and analysis of CRM performance.

Instructions

Get activity report from Upnify by group or executive and period

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agrupacionYesGroup by: 1=Executive, 2=Group
periodoYesPeriod for report filtering. Options: 1=Today, 2=Yesterday, 3=Current week, 4=Last week, 5=Current month, 6=Last month, 8=Current year, 10=Last year, 13=Current semester, 14=Last semester, 17=Current quarter, 18=Last quarter.

Implementation Reference

  • Core handler function that authenticates the user, constructs the API query with agrupacion and periodo parameters, fetches the activity report from the Upnify API endpoint, handles errors, and returns a standardized success response with the data.
    async getActivityReport(tkIntegracion: string, params: ActivityReportParams) {
        try {
            const { token, userInfo } = await this.auth.getTokenAndUserInfo(tkIntegracion);
            
            const queryParams = new URLSearchParams({
                agrupacion: params.agrupacion.toString(),
                periodo: params.periodo.toString()
            });
            
            const response = await fetch(`${API_URLS.UPNIFY_BASE}${ENDPOINTS.REPORTS.ACTIVITIES}?${queryParams}`, {
                method: 'GET',
                headers: {
                    'token': token,
                    'Content-Type': 'application/json',
                }
            });
            
            if (!response.ok) {
                const errorText = await response.text();
                throw new Error(`Error al obtener reporte de actividades: ${response.status} ${response.statusText}. ${errorText}`);
            }
            
            const result = await response.json();
            return {
                success: true,
                message: 'Reporte de actividades obtenido exitosamente',
                data: result,
                parameters: params,
                tkEmpresa: userInfo.tkEmpresa
            };
        } catch (error) {
            throw new Error(`Error al obtener reporte de actividades de Upnify: ${error instanceof Error ? error.message : error}`);
        }
    }
  • main.ts:427-441 (registration)
    Tool dispatch logic in the CallToolRequest handler that validates input parameters, calls the reportsHandler.getActivityReport method, and formats success/error responses.
    } else if (name === 'get-upnify-activity-report') {
        const params = args as any;
        if (!validateActivityReportParams(params)) {
            return createErrorResponse(
                new Error('Se requieren todos los parámetros: agrupacion, periodo'),
                'Validación de parámetros'
            );
        }
    
        try {
            const result = await reportsHandler.getActivityReport(tkIntegracion, params);
            return createSuccessResponse(result);
        } catch (error) {
            return createErrorResponse(error, 'Error al obtener reporte de actividades de Upnify');
        }
  • main.ts:254-274 (registration)
    Tool registration in the ListToolsRequest handler, defining the tool name, description, and MCP input schema with properties, enums, defaults, and required fields.
        name: 'get-upnify-activity-report',
        description: 'Get activity report from Upnify by group or executive and period',
        inputSchema: {
            type: 'object',
            properties: {
                agrupacion: {
                    type: 'integer',
                    description: 'Group by: 1=Executive, 2=Group',
                    enum: [1, 2],
                    default: 2
                },
                periodo: {
                    type: 'integer',
                    description: 'Period for report filtering. Options: 1=Today, 2=Yesterday, 3=Current week, 4=Last week, 5=Current month, 6=Last month, 8=Current year, 10=Last year, 13=Current semester, 14=Last semester, 17=Current quarter, 18=Last quarter.',
                    enum: [1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 17, 18],
                    default: 17
                }
            },
            required: ['agrupacion', 'periodo']
        }
    },
  • TypeScript interface defining the input parameters for the activity report (agrupacion and periodo).
    export interface ActivityReportParams {
        agrupacion: number;
        periodo: number;
    }
  • Validation helper function that checks if the required parameters (agrupacion, periodo) are present before calling the handler.
    export function validateActivityReportParams(params: any): params is ActivityReportParams {
        return (
            params.agrupacion !== undefined &&
            params.periodo !== undefined
        );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe important behavioral aspects: whether this is a read-only operation, what format the report returns, whether it requires specific permissions, or if there are rate limits. For a reporting tool with zero annotation coverage, this is insufficient.

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 communicates the core functionality without any wasted words. It's appropriately sized for a tool with two well-documented parameters and follows a clear subject-verb-object structure.

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?

For a reporting tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the activity report contains, what format it returns, or any behavioral constraints. The agent would need to guess about the output structure and operational characteristics.

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 description coverage is 100%, with both parameters having detailed enum descriptions. The description adds minimal value beyond the schema, only mentioning 'by group or executive and period' which is already covered in the schema's parameter descriptions. Baseline 3 is appropriate when schema documentation is comprehensive.

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 verb 'Get' and resource 'activity report from Upnify', with specific scoping 'by group or executive and period'. It distinguishes from some siblings like 'get-upnify-conversion-report' by specifying the report type, but doesn't explicitly differentiate from all reporting siblings like 'get-upnify-sales-report' beyond the report name.

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?

No guidance on when to use this tool versus alternatives is provided. The description mentions the grouping options but doesn't explain when to choose group vs executive grouping, nor when to use this activity report versus other reporting tools like 'get-upnify-conversion-report' or 'get-upnify-sales-report'.

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

Related 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/adrielisa/MCP'

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