AIP-C01 practice question: Tool integration and MCP servers (Lambda, ECS, AgentCore Gateway) (2 of 2)
Implementation and Integration A free question from our original AIP-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.
A hotel group's AI concierge calls a room-service tool that runs as an AWS Lambda function. The tool places an order in the kitchen system. The model sometimes passes a room number with a stray suffix, or leaves out the required delivery time.
Today the Lambda function throws an unhandled exception on those inputs, and the whole conversation turn fails with an error. The team wants the guest to get a useful reply, and fixable inputs should be corrected and retried. Invalid orders must never reach the kitchen, and the tool's input contract must stay the same.
Which tool design meets these requirements?
Choose one answer.
AA. Remove the input checks from the Lambda function and rely on the kitchen system to reject incomplete orders, so the function stays as small as possible.
BB. Wrap the whole handler in a try block that returns an empty success response for any error, so the conversation continues without an error.
CC. Add a rule to the system prompt that the model must always send a valid room number and delivery time, and leave the Lambda function unchanged.
DD. Validate each input against the tool's JSON schema in the Lambda function before ordering, and return a structured error result that names the bad field.
Show the answer and explanation
Answer: D
A. Wrong: The kitchen system may accept an order with a stray suffix or a missing time, so an invalid order could be placed. The guest would also get no useful reply from the concierge.
B. Wrong: Reporting success for a failed order hides the problem, and the guest may believe food is on its way. The model also cannot correct an input it was told was accepted.
C. Wrong: A prompt instruction reduces errors but cannot guarantee valid input, so the function still needs its own checks. Without validation in the tool, an invalid order can still reach the kitchen.
D. Right: Checks before the kitchen call stop invalid orders, and the schema keeps the input contract the same. The model receives a readable error it can use to correct the room number or time and call the tool again. Learn more: Call a tool with the Converse API (opens in a new tab)
Explanation
Validating inputs in the Lambda function before any order is placed keeps invalid orders out of the kitchen, and the schema preserves the tool's contract. Returning a structured error result lets the model fix a fixable input and retry, so the guest gets a useful reply. Removing checks, faking success and relying on the prompt each fail a requirement.
Want more on Tool integration and MCP servers (Lambda, ECS, AgentCore Gateway)? The 5 full-length practice sets have 6 more Tool integration and MCP servers (Lambda, ECS, AgentCore Gateway) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →