Skip to main content
Glama
ismaeldosil

FinaShopping MCP Server

by ismaeldosil

get-benefits

Find available discounts and benefits for financial product users by category, including Food, Entertainment, Services, and Fuel.

Instructions

Get available benefits and discounts for financial product users. | Obtener beneficios y descuentos disponibles para usuarios de productos financieros.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoBenefit category (Food, Entertainment, Services, Fuel) | Categoría de beneficio (Alimentación, Entretenimiento, Servicios, Combustible)

Implementation Reference

  • Handler for the 'get-benefits' tool. Fetches all benefits using getBenefits(), optionally filters by 'category' parameter, and returns a JSON string with filtered benefits, count, and available categories.
    async ({ category }) => {
      const benefits = await getBenefits();
      let filteredBenefits = [...benefits];
    
      if (category) {
        filteredBenefits = filteredBenefits.filter(b =>
          b.category.toLowerCase().includes(category.toLowerCase())
        );
      }
    
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({
            benefits: filteredBenefits,
            count: filteredBenefits.length,
            categories: [...new Set(benefits.map(b => b.category))]
          }, null, 2)
        }]
      };
    }
  • Input schema for the 'get-benefits' tool, defining an optional 'category' string parameter.
    {
      category: z.string().optional().describe('Benefit category (Food, Entertainment, Services, Fuel) | Categoría de beneficio (Alimentación, Entretenimiento, Servicios, Combustible)')
    },
  • Registration of the 'get-benefits' tool on the MCP server, specifying name, description, and referencing schema and handler.
    server.tool(
      'get-benefits',
      'Get available benefits and discounts for financial product users. | Obtener beneficios y descuentos disponibles para usuarios de productos financieros.',
  • Helper function getBenefits() that calls the API fetchBenefits() and extracts the benefits array.
    /**
     * Fetch benefits from API
     */
    async function getBenefits(): Promise<Benefit[]> {
      const response = await fetchBenefits();
      return response.benefits;
    }
  • Core API fetch function for benefits data from '/api/v1/benefits' endpoint.
     */
    export async function fetchBenefits(): Promise<BenefitsResponse> {
      const response = await apiClient.get<BenefitsResponse>('/api/v1/benefits');
      return response.data;
    }

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/ismaeldosil/finashopping-mcp'

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