Skip to main content
Glama
adrielisa

MCP Server: Weather & Upnify Integration

by adrielisa

get-upnify-conversion-report

Generate Upnify conversion reports by group, executive, origin, or region, filtered by period and situation. Analyze CRM data for effective prospect management with dynamic authentication.

Instructions

Get conversion report from Upnify by group, executive, origin, or region and period

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agrupacionYesGroup by: 1=Executive, 2=Group, 3=Origin, 4=Region
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.
situacionYesSituation: 0=Include discarded, 1=Exclude discarded

Implementation Reference

  • The main handler function that authenticates using UpnifyAuthenticator, constructs query parameters from input (agrupacion, periodo, situacion), fetches the conversion report from the Upnify API endpoint, handles errors, and returns a formatted success response with the data.
    async getConversionReport(tkIntegracion: string, params: ConversionReportParams) {
        try {
            const { token, userInfo } = await this.auth.getTokenAndUserInfo(tkIntegracion);
            
            const queryParams = new URLSearchParams({
                agrupacion: params.agrupacion.toString(),
                periodo: params.periodo.toString(),
                situacion: params.situacion.toString()
            });
            
            const response = await fetch(`${API_URLS.UPNIFY_BASE}${ENDPOINTS.REPORTS.CONVERSIONS}?${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 conversiones: ${response.status} ${response.statusText}. ${errorText}`);
            }
            
            const result = await response.json();
            return {
                success: true,
                message: 'Reporte de conversiones obtenido exitosamente',
                data: result,
                parameters: params,
                tkEmpresa: userInfo.tkEmpresa
            };
        } catch (error) {
            throw new Error(`Error al obtener reporte de conversiones de Upnify: ${error instanceof Error ? error.message : error}`);
        }
    }
  • TypeScript interface defining the expected input parameters for the get-upnify-conversion-report tool.
    export interface ConversionReportParams {
        agrupacion: number;
        periodo: number;
        situacion: number;
    }
  • main.ts:443-457 (registration)
    Registration and dispatch logic in the CallToolRequest handler that validates input parameters using validateConversionReportParams and calls the reportsHandler.getConversionReport method.
    } else if (name === 'get-upnify-conversion-report') {
        const params = args as any;
        if (!validateConversionReportParams(params)) {
            return createErrorResponse(
                new Error('Se requieren todos los parámetros: agrupacion, periodo, situacion'),
                'Validación de parámetros'
            );
        }
    
        try {
            const result = await reportsHandler.getConversionReport(tkIntegracion, params);
            return createSuccessResponse(result);
        } catch (error) {
            return createErrorResponse(error, 'Error al obtener reporte de conversiones de Upnify');
        }
  • main.ts:276-302 (registration)
    Tool registration in ListToolsRequestHandler, including name, description, and inputSchema definition matching the ConversionReportParams type.
        name: 'get-upnify-conversion-report',
        description: 'Get conversion report from Upnify by group, executive, origin, or region and period',
        inputSchema: {
            type: 'object',
            properties: {
                agrupacion: { 
                    type: 'integer', 
                    description: 'Group by: 1=Executive, 2=Group, 3=Origin, 4=Region', 
                    enum: [1, 2, 3, 4], 
                    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: 5 
                },
                situacion: { 
                    type: 'integer', 
                    description: 'Situation: 0=Include discarded, 1=Exclude discarded', 
                    enum: [0, 1], 
                    default: 0 
                }
            },
            required: ['agrupacion', 'periodo', 'situacion']
        }
    }
  • Type guard function used to validate that input parameters include all required fields for the conversion report.
    export function validateConversionReportParams(params: any): params is ConversionReportParams {
        return (
            params.agrupacion !== undefined &&
            params.periodo !== undefined &&
            params.situacion !== 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 but only states what the tool does without behavioral details. It doesn't disclose if this is a read-only operation, requires authentication, has rate limits, returns paginated data, or what the output format looks like. For a reporting tool with zero annotation coverage, this is inadequate.

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?

Single sentence, front-loaded with the core purpose, efficiently listing key dimensions without redundancy. Every word earns its place, making it easy to scan and understand 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?

For a reporting tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on output format, data scope, error handling, or behavioral traits. While concise, it doesn't compensate for the missing structured information needed for reliable agent use.

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 all parameters well-documented in the schema (agrupacion, periodo, situacion). The description adds minimal value by listing grouping options and period, but doesn't provide additional context beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 conversion report') and resource ('from Upnify'), with specific grouping dimensions listed (group, executive, origin, region) and period. It distinguishes from siblings like 'get-upnify-activity-report' and 'get-upnify-sales-report' by focusing on conversion metrics, though it doesn't explicitly contrast them.

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 explicit guidance on when to use this tool versus alternatives like 'get-upnify-sales-report' or 'get-upnify-activity-report'. The description implies usage for conversion analysis by group/period but lacks context on prerequisites, exclusions, or comparisons to sibling tools.

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