LEARN. PRACTICE. EXPLAIN.
Learning paths & interview practiceP
← Build a tenant-safe MCP tool server & eval runner
BUILD → VERIFY → EXPLAIN · STEP 1 OF 6

Validate MCP tool schemas strictly

Reject unknown tools, missing parameters, invalid enums, and unexpected keys.

UNDERSTAND

Bring these concepts with you

BUILD

Your implementation

  1. Download starter.mjs and checks.mjs into one empty folder. Use Node.js 22.12+.
  2. Implement validateToolCall(registry, toolName, args) checking tool existence, required args, types/maxLength, and enum values.
  3. Reject any unexpected argument keys (such as an injected organizationId) with terminal: true.
export function validateToolCall(registry, toolName, args) {
  // Validate tool existence, required fields, types, enums, and unexpected keys.
}
Need a hint?
  • Never allow extra undocumented keys through to the tool handler.
  • Return { ok: false, terminal: true, error } so the agent loop does not blindly retry invalid parameters.

Saved on this device · 0 / 6000 · Do not include passwords or private data.

VERIFY

Acceptance checks

From the folder containing your downloaded files, run:

node checks.mjs ./starter.mjs 1

This runs checks up to this step. Earlier steps must work first. Mark each result only after checking your implementation; the website does not run or grade it.

Record your attempt to enable the checklist and reference comparison.

Compare with the reference

Attempt the step first, then compare decisions and behavior. There can be more than one correct implementation.

EXPLAIN

Your interviewer asks

Why do clear tool schemas and parameter exclusions improve agent reliability more than adding extra tools?

Say your answer aloud, then record the trade-offs and evidence in your notes above.

LOCAL VOICE REHEARSAL

Rehearse your step walkthrough aloud

Target pacing: 02:00 · Stays in this browser only; never uploaded.

00:00/ 02:00
AlifBay Prep