Tool Calling
tool-calling
Practice Problems
Handle MCP Tool Requests with Schema Validation
Implement the request handler of a small read-only MCP server for the 2026-07-28 revision: check the JSON-RPC envelope and per-request _meta, list tools with cache hints, validate arguments from each tool's declared schema, and put every failure in the right channel.
Validated Tool Adapter
Validate a model-proposed get_ticket call (tool name, exact arguments, ID format), take the tenant and read permission from trusted context, and return a copy of only that tenant's ticket or a controlled error code.
AI Engineering
Trace a tool call from request to answer
Follow one ticket lookup from tool declaration to answer: what the model proposes, what the application validates and executes, and what the assistant says when the result is unavailable.
Implement a validated, tenant-scoped tool adapter
Implement a get_ticket adapter that validates model-proposed arguments, takes tenant scope from trusted context, and passes a fixture table, then explain how a bounded orchestrator handles timeouts, invalid calls, and parallel lookups.
Extend a tool adapter with a search tool
Extend the validated ticket adapter with a paginated search_tickets tool behind a tool registry under a 3-hour cap, hand in tests and a README, then review a sample submission as the interviewer would.
Choose a fixed workflow or an agent loop
Compare a fixed workflow and an agent loop for a parcel-delivery assistant's rescheduling and stuck-parcel tasks using a pilot's success, cost, and latency figures, then recommend a design per task and say what would change it.
Design an agent with idempotent side effects
Design an agent that closes a ticket and sends one approved closure email safely across duplicate jobs, crashes, timeouts, and concurrent workers, and say exactly what the design can and cannot guarantee.
Explain how a coding assistant gets context and tools
Explain how a coding assistant assembles its context, which component decides whether each proposed action runs, and why an instruction found inside a file cannot grant itself permission.
Build a small MCP server with validated tools
Implement the request handler of a small read-only MCP server that validates tool arguments from their declared schemas and puts each failure in the right channel, then review the trust model of adding a shell tool and installing a third-party server.
