Skip to main content
Glama
ismaeldosil

FinaShopping MCP Server

by ismaeldosil

search-loans

Search and filter loans from Uruguayan financial institutions by amount, term, and type to find suitable options.

Instructions

Search available loans from Uruguayan financial institutions. Filter by amount, term, and type. | Buscar préstamos disponibles en instituciones financieras uruguayas. Filtrar por monto, plazo y tipo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoLoan amount in Uruguayan pesos | Monto del préstamo en pesos uruguayos
termNoTerm in months | Plazo en meses
typeNoLoan type | Tipo de préstamo

Implementation Reference

  • The handler function for the 'search-loans' tool. Fetches all loans using getLoans(), applies optional filters for amount (within 50-200% range), term (50-200% range), and type (keyword match in loan name), then returns a JSON stringified response with filtered loans, count, and applied filters.
    async ({ amount, term, type }) => {
      const loans = await getLoans();
      let filteredLoans = [...loans];
    
      // Filter by amount (±50% range)
      if (amount) {
        const minAmount = amount * 0.5;
        const maxAmount = amount * 2;
        filteredLoans = filteredLoans.filter(
          loan => loan.amount >= minAmount && loan.amount <= maxAmount
        );
      }
    
      // Filter by type
      if (type) {
        const loanName = type.toLowerCase();
        filteredLoans = filteredLoans.filter(loan => {
          const name = loan.name.toLowerCase();
          if (loanName === 'personal') return name.includes('personal');
          if (loanName === 'auto') return name.includes('auto');
          if (loanName === 'hipotecario') return name.includes('hipotec');
          return true;
        });
      }
    
      // Filter by term
      if (term) {
        filteredLoans = filteredLoans.filter(
          loan => loan.term >= term * 0.5 && loan.term <= term * 2
        );
      }
    
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({
            loans: filteredLoans,
            count: filteredLoans.length,
            filters: { amount, term, type }
          }, null, 2)
        }]
      };
    }
  • Input schema for search-loans tool using Zod: optional amount (positive number), term (6-360 months), type (enum: personal, auto, hipotecario).
    {
      amount: z.number().positive().optional().describe('Loan amount in Uruguayan pesos | Monto del préstamo en pesos uruguayos'),
      term: z.number().min(6).max(360).optional().describe('Term in months | Plazo en meses'),
      type: z.enum(['personal', 'auto', 'hipotecario']).optional().describe('Loan type | Tipo de préstamo')
    },
  • Registration of the 'search-loans' tool on the MCP server using server.tool(), including name, bilingual description, input schema, and inline handler function. Called from registerLoanTools.
    server.tool(
      'search-loans',
      'Search available loans from Uruguayan financial institutions. Filter by amount, term, and type. | Buscar préstamos disponibles en instituciones financieras uruguayas. Filtrar por monto, plazo y tipo.',
      {
        amount: z.number().positive().optional().describe('Loan amount in Uruguayan pesos | Monto del préstamo en pesos uruguayos'),
        term: z.number().min(6).max(360).optional().describe('Term in months | Plazo en meses'),
        type: z.enum(['personal', 'auto', 'hipotecario']).optional().describe('Loan type | Tipo de préstamo')
      },
      async ({ amount, term, type }) => {
        const loans = await getLoans();
        let filteredLoans = [...loans];
    
        // Filter by amount (±50% range)
        if (amount) {
          const minAmount = amount * 0.5;
          const maxAmount = amount * 2;
          filteredLoans = filteredLoans.filter(
            loan => loan.amount >= minAmount && loan.amount <= maxAmount
          );
        }
    
        // Filter by type
        if (type) {
          const loanName = type.toLowerCase();
          filteredLoans = filteredLoans.filter(loan => {
            const name = loan.name.toLowerCase();
            if (loanName === 'personal') return name.includes('personal');
            if (loanName === 'auto') return name.includes('auto');
            if (loanName === 'hipotecario') return name.includes('hipotec');
            return true;
          });
        }
    
        // Filter by term
        if (term) {
          filteredLoans = filteredLoans.filter(
            loan => loan.term >= term * 0.5 && loan.term <= term * 2
          );
        }
    
        return {
          content: [{
            type: 'text' as const,
            text: JSON.stringify({
              loans: filteredLoans,
              count: filteredLoans.length,
              filters: { amount, term, type }
            }, null, 2)
          }]
        };
      }
    );
  • Helper function getLoans() that fetches the full list of loans from the API via fetchLoans() for use in search-loans and other loan tools.
    /**
     * Fetch loans from API
     */
    async function getLoans(): Promise<Loan[]> {
      const response = await fetchLoans();
      return response.loans;
    }
  • Central tool registration function that calls registerLoanTools (which registers search-loans among others). This is invoked from the main server setup.
    export function registerAllTools(server: McpServer): void {
      registerLoanTools(server);
      registerCardTools(server);
      registerInsuranceTools(server);
    }
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 the tool searches and filters, but doesn't describe what the search returns (e.g., list of loans, institutions), whether it's read-only, requires authentication, has rate limits, or other behavioral traits. This leaves significant gaps for a search tool.

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 extremely concise—two parallel sentences in English and Spanish with zero wasted words. It front-loads the core purpose and filtering capabilities efficiently, making every sentence earn its place.

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 search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., loan details, institutions), how results are structured, or any behavioral constraints. The high schema coverage doesn't compensate for these missing contextual elements.

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%, so the schema already documents all three parameters thoroughly. The description mentions filtering by amount, term, and type, which aligns with the schema but adds no additional semantic context beyond what's already in the structured fields.

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 tool searches for loans from Uruguayan financial institutions with specific filters (amount, term, type), providing a specific verb ('search') and resource ('loans'). However, it doesn't explicitly differentiate from sibling tools like 'compare-loans' or 'search-credit-cards', which prevents a perfect 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 like 'compare-loans' or 'get-loan-requirements', nor does it mention prerequisites or exclusions. It only lists filtering capabilities without contextual usage advice.

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

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