Skip to main content
Glama

bereken_hypotheek_starter

Calculate maximum mortgage amount for first-time home buyers based on income, age, and partner details to determine monthly payments and NHG comparison.

Instructions

Berekent de maximale hypotheek voor starters. Output: maximaal leenbedrag, maandlast en NHG-vergelijking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inkomen_aanvragerYesBruto jaarinkomen hoofdaanvrager in euro's.
geboortedatum_aanvragerYesGeboortedatum hoofdaanvrager (YYYY-MM-DD).
heeft_partnerYesGeeft aan of een partner mee leent.
inkomen_partnerNoOptioneel partnerinkomen in euro's.
geboortedatum_partnerNoOptionele geboortedatum partner (YYYY-MM-DD).
verplichtingen_pmNoOptionele maandelijkse verplichtingen in euro's.
session_idNoOptioneel sessie-ID vanuit n8n (voor logging).

Implementation Reference

  • The core handler function for the 'bereken_hypotheek_starter' tool. It extracts and validates arguments, constructs the payload, calls the external Replit mortgage calculation API, logs success, and returns a formatted response.
    async function handleBerekenStarter(request: any): Promise<ToolResponse> {
      const args = requireArguments<BaseArguments>(request);
      const logger = createLogger(args.session_id);
    
      validateBaseArguments(args);
      enforceRateLimit(args.session_id);
    
      const payload: any = {
        aanvragers: mapAanvragers(args),
      };
    
      if (args.session_id) {
        payload.session_id = args.session_id;
      }
    
      const apiClient = getApiClient();
      const { data } = await apiClient.post(
        REPLIT_API_URL_BEREKENEN,
        payload,
        { correlationId: args.session_id }
      );
    
      logger.info('Toolcall succesvol', { tool: 'bereken_hypotheek_starter' });
      return successResponse(formatResponse(data, "bereken_hypotheek_starter"));
    }
  • src/index.ts:766-774 (registration)
    Registration of tool handlers in the TOOL_HANDLERS object, mapping 'bereken_hypotheek_starter' to its handler function.
    const TOOL_HANDLERS: Record<string, ToolHandler> = {
      bereken_hypotheek_starter: handleBerekenStarter,
      bereken_hypotheek_doorstromer: handleBerekenDoorstromer,
      bereken_hypotheek_uitgebreid: handleBerekenUitgebreid,
      haal_actuele_rentes_op: handleActueleRentes,
      opzet_hypotheek_starter: handleOpzetStarter,
      opzet_hypotheek_doorstromer: handleOpzetDoorstromer,
      opzet_hypotheek_uitgebreid: handleOpzetUitgebreid,
    };
  • Tool registration including name, description, and input schema definition for 'bereken_hypotheek_starter' in the listTools response.
      name: "bereken_hypotheek_starter",
      description: `Maximale hypotheek voor starters ZONDER concrete woning. Gebruik deze tool alleen wanneer de gebruiker zich oriënteert ("Wat kan ik lenen?") en er nog geen koopsom/adres bekend is. Zodra de gebruiker een specifiek huis of biedprijs noemt moet u overschakelen naar de opzet-hypotheek tools.`,
      inputSchema: {
        type: "object",
        description: `Gebruik basisintakevelden; zie ${OPZET_GUIDE_URI} voor detaildefinities.`,
        properties: {
          ...baseIntakeProperties,
          session_id: {
            type: "string",
            description: "Optioneel sessie-ID vanuit n8n (voor logging).",
          },
        },
        required: baseIntakeRequired,
      },
    },
  • Validation helper function validateBaseArguments used by the handler to validate core input fields like income, birthdate, partner info.
    export function validateBaseArguments(args: unknown): void {
      // Type check
      if (typeof args !== 'object' || args === null) {
        throw new ValidationError(
          ErrorCode.INVALID_INPUT,
          'Arguments moet een object zijn',
          'arguments'
        );
      }
    
      const input = args as Record<string, unknown>;
    
      // Valideer verplichte velden
      if (typeof input.inkomen_aanvrager !== 'number') {
        throw new ValidationError(
          ErrorCode.INVALID_INPUT,
          'inkomen_aanvrager moet een getal zijn',
          'inkomen_aanvrager',
          input.inkomen_aanvrager
        );
      }
    
      if (typeof input.geboortedatum_aanvrager !== 'string') {
        throw new ValidationError(
          ErrorCode.INVALID_INPUT,
          'geboortedatum_aanvrager moet een string zijn',
          'geboortedatum_aanvrager',
          input.geboortedatum_aanvrager
        );
      }
    
      if (typeof input.heeft_partner !== 'boolean') {
        throw new ValidationError(
          ErrorCode.INVALID_INPUT,
          'heeft_partner moet een boolean zijn',
          'heeft_partner',
          input.heeft_partner
        );
      }
    
      // Valideer inkomen range
      if (input.inkomen_aanvrager < ValidationConstraints.INKOMEN.MIN || 
          input.inkomen_aanvrager > ValidationConstraints.INKOMEN.MAX) {
        throw new ValidationError(
          ErrorCode.INCOME_OUT_OF_RANGE,
          `Inkomen aanvrager moet tussen €${ValidationConstraints.INKOMEN.MIN} en €${ValidationConstraints.INKOMEN.MAX} liggen`,
          'inkomen_aanvrager',
          input.inkomen_aanvrager
        );
      }
    
      // Valideer leeftijd aanvrager
      validateAge(input.geboortedatum_aanvrager, 'aanvrager');
    
      // Valideer partner gegevens indien heeft_partner = true
      if (input.heeft_partner) {
        if (input.inkomen_partner !== undefined) {
          if (typeof input.inkomen_partner !== 'number') {
            throw new ValidationError(
              ErrorCode.INVALID_INPUT,
              'inkomen_partner moet een getal zijn',
              'inkomen_partner',
              input.inkomen_partner
            );
          }
    
          if (input.inkomen_partner < ValidationConstraints.INKOMEN.MIN || 
              input.inkomen_partner > ValidationConstraints.INKOMEN.MAX) {
            throw new ValidationError(
              ErrorCode.INCOME_OUT_OF_RANGE,
              `Inkomen partner moet tussen €${ValidationConstraints.INKOMEN.MIN} en €${ValidationConstraints.INKOMEN.MAX} liggen`,
              'inkomen_partner',
              input.inkomen_partner
            );
          }
        }
    
        if (input.geboortedatum_partner) {
          if (typeof input.geboortedatum_partner !== 'string') {
            throw new ValidationError(
              ErrorCode.INVALID_INPUT,
              'geboortedatum_partner moet een string zijn',
              'geboortedatum_partner',
              input.geboortedatum_partner
            );
          }
          validateAge(input.geboortedatum_partner, 'partner');
        }
      }
    
      // Valideer verplichtingen
      if (input.verplichtingen_pm !== undefined) {
        if (typeof input.verplichtingen_pm !== 'number') {
          throw new ValidationError(
            ErrorCode.INVALID_INPUT,
            'verplichtingen_pm moet een getal zijn',
            'verplichtingen_pm',
            input.verplichtingen_pm
          );
        }
    
        if (input.verplichtingen_pm < ValidationConstraints.VERPLICHTINGEN.MIN || 
            input.verplichtingen_pm > ValidationConstraints.VERPLICHTINGEN.MAX) {
          throw new ValidationError(
            ErrorCode.INVALID_INPUT,
            `Verplichtingen moet tussen €${ValidationConstraints.VERPLICHTINGEN.MIN} en €${ValidationConstraints.VERPLICHTINGEN.MAX} liggen`,
            'verplichtingen_pm',
            input.verplichtingen_pm
          );
        }
      }
    }
  • Helper function to map and default applicant arguments into the payload format sent to the API.
    }) {
      return {
        inkomen_aanvrager: args.inkomen_aanvrager,
        geboortedatum_aanvrager: args.geboortedatum_aanvrager,
        heeft_partner: args.heeft_partner,
        inkomen_partner: args.inkomen_partner ?? 0,
        geboortedatum_partner: args.geboortedatum_partner ?? null,
        verplichtingen_pm: args.verplichtingen_pm ?? 0,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While it mentions the output format (maximum loan amount, monthly payment, NHG comparison), it doesn't describe what 'NHG-vergelijking' entails, whether calculations follow specific regulations, if there are rate limits, or what assumptions are made. For a financial calculation tool with no annotation coverage, this is insufficient behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences: one stating the purpose and one listing the outputs. It's front-loaded with the core function. However, the second sentence could be more integrated, and there's some room to improve flow without adding unnecessary length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (financial calculation with 7 parameters), lack of annotations, and no output schema, the description is minimally adequate. It states what the tool does and the output format, but doesn't provide enough context about behavioral aspects, usage scenarios, or detailed output interpretation. The 100% schema coverage helps, but more completeness would be needed for optimal agent understanding.

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 7 parameters well-documented in the input schema. The description adds no parameter-specific information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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's purpose: 'Berekent de maximale hypotheek voor starters' (calculates maximum mortgage for starters). It specifies the verb (calculates) and resource (maximum mortgage for starters), but doesn't explicitly differentiate from sibling tools like bereken_hypotheek_doorstromer or bereken_hypotheek_uitgebreid, which appear to be similar calculators for different user segments.

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. It doesn't explain what makes a user a 'starter' versus a 'doorstromer' (mover) or when to choose this tool over bereken_hypotheek_uitgebreid (extended calculation). There's no mention of prerequisites, exclusions, or comparative use cases with 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

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/pace8/Test'

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