Skip to main content
Glama
pace8

mcp-hypotheken-berekenen

opzet_hypotheek_starter

Calculate mortgage setup for first-time homebuyers. Get total required amount, financing overview, and monthly payments based on income and property details.

Instructions

Berekent de hypotheekopzet voor starters. Output: totaal benodigd bedrag, financieringsoverzicht en maandlast.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aanvragerYesGegevens van de (hoofd)aanvrager. Vraag altijd: "Wat is uw leeftijd of geboortedatum?" en gebruik opgegeven leeftijden alleen intern.
nieuwe_woningYesKerngegevens nieuwe woning (detailuitleg: hypotheek://v4/guide/opzet-intake).
session_idNoOptioneel sessie-ID vanuit n8n (voor logging).

Implementation Reference

  • The primary handler function for the 'opzet_hypotheek_starter' tool. It extracts and normalizes arguments, performs validation, constructs a payload, calls the external Replit API endpoint for opzet calculations, and returns a formatted response.
    async function handleOpzetStarter(request: any): Promise<ToolResponse> {
      const rawArgs = requireArguments<OpzetStarterArguments>(request);
      const normalizedArgs = normalizeOpzetAanvragerShape(rawArgs) as OpzetStarterArguments;
      const logger = createLogger(normalizedArgs.session_id);
    
      const aanvrager = requireOpzetAanvrager(normalizedArgs);
      validateOpzetAanvrager(aanvrager);
      enforceRateLimit(normalizedArgs.session_id);
    
      const payload: any = {
        aanvrager: mapOpzetAanvrager(aanvrager),
        nieuwe_woning: {
          waarde_woning: normalizedArgs.nieuwe_woning.waarde_woning,
          bedrag_verbouwen: normalizedArgs.nieuwe_woning.bedrag_verbouwen ?? 0,
          bedrag_verduurzamen: normalizedArgs.nieuwe_woning.bedrag_verduurzamen ?? 0,
          kosten_percentage: normalizedArgs.nieuwe_woning.kosten_percentage ?? 0.05,
          energielabel: normalizeEnergielabel(normalizedArgs.nieuwe_woning.energielabel || ''),
        },
      };
    
      if (normalizedArgs.session_id) {
        payload.session_id = normalizedArgs.session_id;
      }
    
      const apiClient = getApiClient();
      const { data } = await apiClient.post(
        REPLIT_API_URL_OPZET,
        payload,
        { correlationId: normalizedArgs.session_id }
      );
    
      logger.info('Toolcall succesvol', { tool: 'opzet_hypotheek_starter' });
      return successResponse(formatResponse(data, "opzet_hypotheek_starter"));
    }
  • Defines the tool's metadata including name, detailed description, and JSON input schema specifying required 'aanvrager' and 'nieuwe_woning' objects with their properties.
      name: "opzet_hypotheek_starter",
      description: `Opzet-berekening voor starters met een CONCRETE woning. Gebruik dit zodra de gebruiker een huis/koopprijs noemt en wil weten “kan ik deze woning kopen, hoe ziet de financiering eruit?”. Voor louter oriëntatie zonder woning blijft u bij de maximale-hypotheek tools. Dit is de standaardvariant; kies opzet_hypotheek_uitgebreid wanneer de gebruiker expliciet scenario’s/leningdelen wil tweaken.`,
      inputSchema: {
        type: "object",
        description: `Gebruik basisintake plus woninginfo; zie ${OPZET_GUIDE_URI} voor detailvelden en defaults.`,
        properties: {
          aanvrager: aanvragerSchema,
          nieuwe_woning: {
            ...nieuweWoningSchema,
          },
          session_id: {
            type: "string",
            description: "Optioneel sessie-ID vanuit n8n (voor logging).",
          },
        },
        required: [
          "aanvrager",
          "nieuwe_woning",
        ],
      },
    },
  • src/index.ts:766-774 (registration)
    Maps the tool name 'opzet_hypotheek_starter' to its handler function 'handleOpzetStarter' in the central TOOL_HANDLERS registry used by the MCP CallToolRequestHandler.
    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,
    };
  • Helper function used by the handler to normalize legacy flat argument structure into the required nested 'aanvrager' object format.
    export function normalizeOpzetAanvragerShape(args: any): any {
      if (!args || typeof args !== 'object') {
        return args;
      }
    
      if (args.aanvrager && typeof args.aanvrager === 'object') {
        return args;
      }
    
      const legacy = { ...args };
      if (
        typeof legacy.inkomen_aanvrager === 'number' &&
        typeof legacy.geboortedatum_aanvrager === 'string' &&
        typeof legacy.heeft_partner === 'boolean'
      ) {
        legacy.aanvrager = {
          inkomen_aanvrager: legacy.inkomen_aanvrager,
          geboortedatum_aanvrager: legacy.geboortedatum_aanvrager,
          heeft_partner: legacy.heeft_partner,
          inkomen_partner: legacy.inkomen_partner,
          geboortedatum_partner: legacy.geboortedatum_partner,
          verplichtingen_pm: legacy.verplichtingen_pm,
          eigen_vermogen: legacy.eigen_vermogen,
        };
      }
    
      return legacy;
    }
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 the calculation function and output format. It doesn't disclose important behavioral traits like whether this is a read-only calculation or if it creates records, what permissions might be needed, whether it has rate limits, or how it handles errors. The output description is helpful but insufficient for a tool with complex nested parameters.

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 a single sentence that front-loads the core purpose and follows with output details. Every element serves a purpose, though it could be slightly more structured by separating purpose from output specification.

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 complex mortgage calculation tool with nested objects, no annotations, and no output schema, the description is insufficient. It doesn't explain the calculation methodology, assumptions, limitations, or error conditions. The output description helps but doesn't compensate for the lack of behavioral context needed for proper tool invocation.

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?

With 100% schema description coverage, the baseline is 3. The tool description adds no parameter-specific information beyond what's already documented in the comprehensive input schema descriptions. It doesn't explain relationships between parameters or provide additional context about how the calculation uses these inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/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 with a specific verb ('Berekent' - calculates) and resource ('hypotheekopzet voor starters' - mortgage setup for starters), and distinguishes it from siblings by specifying it's for 'starters' rather than 'doorstromer' or 'uitgebreid' variants.

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 the sibling tools like 'opzet_hypotheek_doorstromer' or 'opzet_hypotheek_uitgebreid'. It doesn't explain what makes a 'starter' different from other mortgage applicants or when to choose this specific variant.

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/mcp-hypotheken-berekenen'

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