Module deck

Tools and agents flashcards

Reviewing needs JavaScript. You can read every card in the list below.

Loading your cards...

Back to the module18 cards in this deck

Read all 18 cards as a list

Function and tool calling

  1. Front
    What does the model actually do when it "calls a function"?
    Back
    It emits a structured request (tool name plus arguments). Something outside the model executes it; for your own tools that is your application, which returns the result linked to the call id.
  2. Front
    What does a tool definition contain, and why does its quality matter?
    Back
    Name, description and JSON-schema parameters (with required fields). It is the only thing the model knows about the tool, so vague names, empty descriptions or free-text arguments lead to wrong calls.
  3. Front
    Why make side-effecting tools idempotent?
    Back
    Retries and loops can repeat a call. An idempotency key lets the downstream service recognise a repeat and not charge twice or send a duplicate email.
  4. Front
    Name four controls your executor applies to a model-proposed call.
    Back
    Validate arguments, authorize from the real session (not a model-supplied id), set timeouts with bounded retries, and treat results as untrusted. Add idempotency keys for side effects.
  5. Front
    Does strict mode make a tool call safe?
    Back
    No. Strict mode makes arguments follow the schema more reliably. It does not check permissions or whether the values are sensible, so executor checks stay.
  6. Front
    Client tools vs provider-hosted tools?
    Back
    Client tools are defined by you and run in your code. Hosted tools (for example web search or code execution) run on the provider's infrastructure, with less code for you but less control and possible extra charges.

Agentic patterns: ReAct, planning and memory

  1. Front
    What is the ReAct pattern?
    Back
    An explicit loop of Thought, Action (a tool call) and Observation (the tool result), repeated until the goal is met or a stopping control fires.
  2. Front
    Plan-then-execute vs reactive planning: trade-offs?
    Back
    Plan-then-execute is predictable and reviewable up front but brittle when the world deviates (needs checkpoints and replanning). Reactive adapts to each observation but costs more calls and can wander.
  3. Front
    What stopping controls does an agent loop need?
    Back
    A checkable done criterion, step cap, time and cost budgets, loop detection, escalation to a human when ambiguous, and tracing.
  4. Front
    How do you detect an agent stuck in a loop?
    Back
    Watch for the same tool called with the same arguments again, or several steps with no new information. Then stop, return a partial result and ask the user.
  5. Front
    Short-term vs long-term agent memory, and one risk of long-term?
    Back
    Short-term is the current context and scratchpad. Long-term is stored outside and retrieved when relevant. Risks include privacy of stored personal data and stale facts.
  6. Front
    Workflow vs agent, and when to prefer a workflow?
    Back
    A workflow follows predefined code paths; an agent lets the model direct its own steps and tools. Prefer the simpler design when the path is predictable, since agents cost more and can compound errors.

Model Context Protocol and tool ecosystems

  1. Front
    What problem does MCP solve and how does it relate to function calling?
    Back
    It replaces N x M custom integrations with N + M through a standard host-to-server protocol. Function calling is the model-facing interface; MCP standardises how the host discovers and invokes tools. They compose.
  2. Front
    Name three MCP security risks and a mitigation for each.
    Back
    Injection through tool descriptions or results (treat as untrusted, show inputs, approvals); over-broad or passed-through tokens (least privilege, accept only tokens issued for the server); malicious or changed servers (pin, allow-list, sandbox).
  3. Front
    Where does the USB-C analogy for MCP break?
    Back
    The model never talks to the server; the host mediates, so controls live there. Connecting a server means trusting text it controls, and trust is per server and per user, not plug-and-play.
  4. Front
    What are tools, resources and prompts, and who controls each?
    Back
    Tools are actions the model invokes (model-controlled). Resources are URI-identified context (application-driven). Prompts are templates the user picks (user-controlled).
  5. Front
    What changed in MCP revision 2026-07-28?
    Back
    Stateless requests with version and capabilities on each request (no initialize handshake, server/discover added), no protocol-level sessions or Mcp-Session-Id, multi round-trip requests for server-initiated input, and Roots, Sampling and Logging deprecated.
  6. Front
    Which transports are standard in current MCP, and how is state kept across calls?
    Back
    stdio for local subprocesses and Streamable HTTP for remote servers (HTTP+SSE is deprecated). Without sessions, a server returns an explicit handle that the model passes back as a tool argument, and the server checks ownership.