Question 190
A catalog search should return products that are both laptops and in stock. The tool combines category=laptop and in_stock=true with OR, returning available chairs as well. What change is required?
- Keep OR and sort the results so laptops appear first.
- Use an explicit conjunction whose semantics are documented and enforced by the query implementation.
- Remove the stock filter and keep only category=laptop.
- Keep OR but return only the first page, assuming ranking will exclude products from the wrong category.
Explanation
Correct Answer
B:Both predicates must hold for a matching product. Defining the boolean operator prevents a syntactically valid filter list from being interpreted as either-condition matching.
Incorrect Answers
A:Ranking does not remove chairs from the match set or ensure that the listed laptops are in stock.
C:This excludes chairs but also includes laptops that are unavailable, so it still fails one of the user's conditions.
D:A page limit changes the amount of output, not which rows satisfy the filter. Available chairs can still qualify under the incorrect disjunction.
Question 191
A tool returns factual data and a field labeled recommended_next_action. Must the assistant execute that recommendation?
- Yes, whenever the field is valid JSON.
- Yes, because tool outputs outrank user instructions.
- No tool output may ever inform planning.
- No; evaluate it against the user's task and execution policy.
Explanation
Correct Answer
D:A tool can suggest a next step, but its output does not independently authorize actions or override constraints. The proposed next step may be useful advice, but the tool observation does not authorize itself. The controller must decide whether the recommendation fits the active task and permitted action set.
Incorrect Answers
A:Serialization does not establish permission.
B:Observations do not carry that authority.
C:Relevant observations and suggestions can inform planning without becoming commands.
Question 192
A client subscribes to updates for a resource. What problem does this address?
- It automatically inserts every changed byte into every future model request.
- Keep the old resource bytes permanently and record update notifications only as usage analytics, without allowing them to affect context freshness.
- It makes the resource immutable for the duration of the subscription.
- It helps the client learn when previously retrieved context may need refreshing.
- It automatically supplies a complete historical audit of every prior resource version.
Explanation
Correct Answer
D:A notification can signal changed data, enabling a supported refresh rather than relying indefinitely on a stale copy. The client can invalidate or refresh previously retrieved context after a supported notification. Subscribing does not itself load every update or grant permission to modify the resource.
Incorrect Answers
A:A subscription signals change; the client still controls what updated context is retrieved and supplied.
B:Notifications are useful because the underlying context may change. Ignoring them for refresh decisions leaves the original staleness problem unresolved.
C:Update notifications exist to communicate changes and do not impose a write lock on the resource.
E:A change subscription helps the client react to updates. It does not by itself provide a version archive or reconstruct changes from before the subscription.
Question 193
A client cancels a long-running tool request. What must it avoid assuming without a service guarantee?
- That the client can stop waiting locally even if the remote operation's outcome remains unresolved.
- That cancellation proves no external effect occurred.
- That a readback may be needed to determine whether the requested mutation already committed.
- That the user may need to be told the request was canceled while its external outcome is still uncertain.
Explanation
Correct Answer
B:Cancellation can arrive after a remote commit, so ending the local request is not evidence of rollback. Reconcile the operation's external state using the service's documented outcome checks.
Incorrect Answers
A:Local cancellation can end the wait without making a claim about remote state. It is the unverified external outcome that still needs reconciliation.
C:Readback is a reasonable response to uncertainty about an external effect. It does not assume that cancellation itself undid the operation.
D:Separating the local request status from the remote outcome is accurate when the service provides no stronger cancellation guarantee.
Question 194
A tool constructs SQL by concatenating model-generated filter text. What implementation change addresses injection risk?
- Use parameterized queries and validate allowed filter structure.
- Log the completed query after execution.
- Ask the model to promise safe input.
- Validate that the concatenated filter is a string, then execute it unchanged.
Explanation
Correct Answer
A:Input should be bound as data within a constrained query. Validation limits supported fields and operators without trusting generated SQL text. Parameters keep values from becoming query syntax, while an allowed query structure limits what operations the application exposes. Escaping advice in a prompt is not an equivalent execution boundary.
Incorrect Answers
B:Logging cannot prevent an injected command from running.
C:A promise does not enforce query structure.
D:A string type check does not prevent its contents from becoming SQL syntax when interpolated.
Question 195
A file-read tool should access only a workspace directory. What should its implementation validate?
- Only the filename extension.
- Only the model's explanation for reading it.
- Only that the submitted path starts with the workspace name before canonical resolution.
- The resolved path stays within the authorized root, including traversal and link behavior.
Explanation
Correct Answer
D:String prefixes alone can miss path normalization or symlink escapes. Access checks must match the actual filesystem target. Path validation must consider the final target after normalization and relevant link resolution. A harmless-looking input string can otherwise address a file beyond the authorized workspace.
Incorrect Answers
A:An allowed extension can exist outside the permitted directory.
B:Intent text is not a filesystem boundary.
C:Traversal segments or links can resolve outside the intended directory despite a superficially acceptable prefix.
Question 196
A URL-fetch tool accepts arbitrary model-generated URLs. What control helps prevent unintended access to internal network endpoints?
- Trust any URL containing the company name.
- Allow all redirects without checking destinations.
- Apply destination policy, address validation, and redirect-aware network restrictions.
- Validate only that the input starts with http.
Explanation
Correct Answer
C:The implementation must control where requests can actually go, including internal addresses and changes during resolution or redirection. Destination checks must cover resolution and subsequent redirects, not merely the URL scheme. An initially permitted address should not become a route to a disallowed internal service.
Incorrect Answers
A:Hostnames and text fragments can be deceptive.
B:A permitted initial URL can redirect to a forbidden endpoint.
D:The scheme alone does not constrain network destination.
Question 197
An MCP tool returns an image content block, but a client treats its encoded bytes as ordinary prose. What should the adapter preserve?
- The content-block type, encoding, and media type needed by the receiving model or renderer.
- A fabricated caption presented as the original tool output.
- Only the length of the encoded string.
- The tool name alone while discarding the image.
Explanation
Correct Answer
A:Typed adaptation lets the consumer interpret the bytes as the intended image rather than meaningless text. Content metadata tells downstream components how to decode and present the returned bytes. A textual wrapper alone cannot make image data meaningful to a consumer expecting prose.
Incorrect Answers
B:Inventing a description replaces the source data with an unsupported interpretation.
C:Length does not retain the image data's type or make it usable as visual input.
D:The name cannot substitute for the returned visual content required by the task.
Question 198
A tool denies access to a record. How much detail should it expose?
- A false no-match result in every case.
- A reusable administrator token so the caller can bypass the denial.
- Enough to explain the denial and supported remedy without unnecessary sensitive disclosure.
- All other users who can access the record.
Explanation
Correct Answer
C:A useful error can guide authorized recovery while avoiding information leaks about protected resources or identities. An access-denied response should support legitimate recovery without enumerating unrelated users or secrets. Diagnostic usefulness does not require exposing the complete permission graph.
Incorrect Answers
A:Misrepresenting denial as absence can mislead workflow decisions; any deliberate concealment policy must be explicit.
B:A denial should explain an authorized recovery route; issuing privileged credentials in the error would bypass the access boundary.
D:That may disclose unrelated permission information.
Question 199
An export paginates a changing dataset using numeric offsets. New rows inserted between page reads cause duplicates and omissions. Which contract improvement targets this problem?
- Sort each returned page independently after retrieval.
- Remove all record identifiers from export results.
- Use a supported stable snapshot or cursor consistency model and document its guarantees.
- Increase page size slightly and assume the dataset stops changing.
Explanation
Correct Answer
C:A defined view of the dataset prevents offset shifts from silently changing page membership. Offset positions shift when rows enter or leave the dataset. A stable traversal contract defines whether the export represents one snapshot or a documented evolving view.
Incorrect Answers
A:Local page sorting cannot recover rows skipped between offset-based reads.
B:Without identities, the caller has less ability to detect duplicated or missing records.
D:A larger page may reduce requests but does not establish a consistent view across them.
Question 200
A team changes an MCP connection's transport. What must remain distinguished from that choice?
- Whether connection failures can occur.
- Whether the client can reach the server.
- How the client detects a disconnected message channel.
- The framing and delivery mechanisms used to exchange protocol messages over the selected connection.
- The tool's business semantics and authorization requirements.
Explanation
Correct Answer
E:A transport change alters message carriage and connection behavior. The operation's effects and access rules remain application contracts that must be evaluated separately.
Incorrect Answers
A:Availability concerns are relevant to transport.
B:Reachability is also a transport concern.
C:Connection lifecycle and failure detection belong to transport handling. They do not define whether a tool's underlying business operation is permitted.
D:Message carriage is directly part of the transport choice. The tool's business effects and access rules remain separate responsibilities.