Skip to lesson

NVIDIANVIDIA-Certified Professional: Agentic AI2026-100 Prerequisites

Distinguish tool requests from structured answers

Completed by the knowledge check

Learning objective

Explain tool calling with JSON Schema function definitions and structured outputs.

Core idea

Tool calling asks a model to select a named operation and propose its arguments. Structured output constrains the shape of generated data. Both can use JSON Schema, but they serve different purposes: one requests an action from an executor; the other returns data to a consumer.

A schema-valid object establishes structural validity. It does not establish that the proposed operation is authorized, that its arguments refer to a real record, or that the generated facts are correct.

How it works

In the OpenAI-compatible Chat Completions shape used by NVIDIA NIM, the request’s tools array describes available functions. Each function has a name, a description, and a parameters schema. Here is an illustrative definition for a read-only shipment lookup:

{
  "type": "function",
  "function": {
    "name": "lookup_shipment",
    "description": "Read the status of one shipment by its identifier.",
    "parameters": {
      "type": "object",
      "properties": {
        "shipment_id": { "type": "string" }
      },
      "required": ["shipment_id"],
      "additionalProperties": false
    }
  }
}

JSON Schema’s properties defines the permitted named fields and their schemas; it does not itself make those fields mandatory. required supplies that requirement. additionalProperties: false rejects fields outside this object’s declarations. The example checks a string’s presence and type, not whether that shipment exists or belongs to the caller.

The model can return tool_calls instead of a final answer. The application parses the proposed arguments, validates them, invokes the selected implementation if permitted, and returns the execution result for the model’s next step. The model’s proposal alone is not evidence that a lookup ran. See 2.3.1 for complete tool definitions and 2.3.2 for execution-time controls.

The model only proposes the call; the application validates it and, if permitted, invokes the implementation.

The model only proposes the call, and the application validates it and, if permitted, invokes the implementationThe application sends a request that describes the available functions. The model returns tool_calls instead of a final answer. The application parses and validates the proposed arguments. Only if permitted does it invoke the selected implementation and return the execution result for the model's next step.ImplementationModelApplicationopt[if permitted]available functionstool_callsparses the proposed argumentsvalidates the argumentsinvokes the implementationexecution result

NIM’s tool-calling page documents --enable-auto-tool-choice and a model-matching --tool-call-parser for its vLLM serving path. Some packaged model profiles configure parsers, so read that model’s deployment page before applying generic launch instructions. Supplying a schema to an arbitrary model or parser does not establish tool-calling support.

For a structured answer, vLLM documents response_format with type: "json_schema" and a json_schema containing name and schema. That schema describes the answer rather than an operation to dispatch. NIM publishes the running container’s request schema at /docs; verify the deployed interface instead of assuming every backend accepts identical fields. See 2.1.2 for schema-constrained output validation and repair.

Key distinctions and trade-offs

Valid JSON versus valid schema: An object can parse successfully while missing a required field. A schema can accept a string while the business system rejects the identifier it contains.

Parser versus executor: A parser extracts tool-call structure from model output. The executor performs the operation. Neither role can substitute for the other.

Output shape versus meaning: Constraining the response makes downstream parsing more predictable. It does not independently verify the response’s factual content.

Architecture / decision scenario

A freight assistant handles 3,000 status requests daily. Its customer-facing response needs two fields: shipment status and an explanatory sentence. The tempting shortcut asks the model to emit those fields directly because the response already parses as JSON. In an illustrative test of that shortcut, all 100 responses parse, but eight cite nonexistent shipments: a semantic failure despite perfect parsing.

The integration owner rejects that shortcut: the answer needs a live shipment lookup. The application exposes lookup_shipment, validates the proposed identifier, and executes the read before requesting the structured answer. Acceptance of the adopted design requires unknown identifiers to produce an explicit not-found outcome rather than a generated shipment status. The tool result supplies business data, while the answer schema supplies the downstream shape.

Common exam traps

  • Assuming properties makes every field required.
  • Treating valid JSON as schema validation.
  • Treating a tool call as proof of successful execution.
  • Assuming schema conformance proves authorization or factual correctness.

What to remember

Use function schemas to describe callable operations and answer schemas to describe returned data. Validate at the receiving boundary, verify the deployed model and parser interface, and keep structural correctness separate from business correctness.

Knowledge check

References