Cloud concept · Updated

Tool Use - Tool use enables a foundation-model application to request external functions, APIs, or utilities to retrieve information, perform calculations, or take actions.

In short

A foundation model can select a tool and generate structured arguments, while the application or managed agent runtime validates and executes the request. This connects language-based reasoning to current data and business systems, enabling AI agents to complete tasks rather than only generate text.

Cloud Concepts Hub →

6 key aspects of Tool Use

Effective tool use combines clear interfaces and flexible model-driven selection with deterministic security, reliability, and execution controls.

01
Explicit tool contracts

Define each tool's purpose, input schema, and expected output clearly. Narrow business-level interfaces reduce ambiguous selections and make requests easier to validate.

02
Separation of selection and execution

The model proposes a tool call, but application code or a managed runtime performs the operation. Treat the proposal as untrusted input and verify execution results before reporting success.

03
Goal-directed agent orchestration

Agents can select tools, examine results, and coordinate further actions toward a business goal. Bound the number of steps and provide clear stopping or escalation conditions.

04
Authorization and approval controls

Enforce user-specific access and least-privilege permissions outside the model. Require application-enforced approval for consequential actions such as payments or destructive changes.

05
Reliable execution

Use timeouts, bounded retries, and explicit error handling for external dependencies. Apply idempotency controls to state-changing operations so repeated requests do not create duplicate effects.

06
Traceability and evaluation

Capture tool requests, outcomes, and approval decisions while protecting sensitive data. Test tool-selection accuracy, argument validity, authorization enforcement, and end-to-end task completion.

Cloud services for Tool Use

Amazon Bedrock provides model capabilities and managed agent orchestration, while AWS Lambda or APIs exposed through Amazon API Gateway connect tool requests to business operations. AWS Step Functions can place those operations inside controlled workflows with retries, error paths, and approval integration. IAM limits the AWS permissions available to each execution component. Together, these services separate model-driven tool selection from controlled execution: the application still validates arguments, enforces user authorization, checks outcomes, and decides when a human must approve an action.

Amazon Bedrock

Amazon Bedrock supports tool use with compatible foundation models, enabling structured requests that application code can execute and return as tool results. Agents for Amazon Bedrock can orchestrate configured action groups, including operations implemented through AWS Lambda or returned to the application for execution.

AWS LambdaAWS Lambda

AWS Lambda can implement tool operations such as checking inventory or creating a support ticket. Function code should validate arguments, enforce business rules, and use narrowly scoped permissions when accessing downstream systems.

Amazon API GatewayAmazon API Gateway

Amazon API Gateway exposes backend operations through managed API endpoints that a tool executor can call. Configured authentication, authorization, throttling, and request validation help control access, while backend code remains responsible for business-level checks.

AWS Step FunctionsAWS Step Functions

AWS Step Functions can coordinate deterministic workflows invoked by an agent or orchestrate application steps around model calls. It supports explicit state transitions, retries, error handling, and callback patterns that can support approval processes.

Tool Use exam questions

Real practice exam questions on Tool Use, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01 (beta)

An energy company has built an AI agent that investigates unusually high electricity bills. The agent chooses which account records and meter readings to inspect, then uses the results to decide whether further checks are needed. The required operations already exist as supported business APIs and AWS Lambda functions. The company wants to retain its agent's decision logic while giving it a consistent way to discover and invoke these operations, with minimal custom integration code. Which solution best meets these requirements?

Show answerCORRECT ANSWER

Use Amazon Bedrock AgentCore Gateway to expose the existing operations as MCP tools, and connect the agent to that tool interface while retaining its decision logic.

AgentCore Gateway can expose supported APIs and Lambda functions through a consistent Model Context Protocol (MCP) tool interface, reducing custom adapter code. The existing agent still selects actions and evaluates results; Gateway provides tool connectivity rather than replacing the agent's reasoning.

AIP-C01

A company uses the Amazon Bedrock Converse API for an accounts-payable assistant. The application exposes tools that retrieve invoice details, retrieve payment status, and convert currencies. After a model update, all generated tool requests still pass JSON Schema validation, but reviewers find that the assistant sometimes supplies the wrong invoice identifier, reverses the source and target currencies, or ignores returned payment statuses.

The developer must build an automated pre-release benchmark that measures whether the model selects appropriate tools, supplies semantically correct arguments, and uses the results correctly. The benchmark must also detect unnecessary currency conversions and must not call production financial APIs. Which approach best meets these requirements?

Show answerCORRECT ANSWER

Run the complete tool-use loop against isolated, contract-faithful test implementations with controlled invoice, payment, and exchange-rate fixtures. Check requested tools and argument values against each case's requirements, return results correlated to the tool requests, and verify the final answer against those results. Include cases with no conversion requirement and enforce case-specific allowed-call budgets.

This evaluates tool selection, argument semantics, and use of returned observations without accessing production systems. Controlled fixtures make wrong identifiers, reversed currency arguments, and ignored payment statuses detectable. Cases that require no conversion and case-specific call budgets expose unnecessary tool usage.

AIF-C01

A sales company uses an AI agent powered by Amazon Bedrock to record follow-up tasks in its customer relationship management (CRM) system. A salesperson asks, "Create a follow-up task for Jordan at Summit next Tuesday." An authorized CRM lookup returns two contacts named Jordan at different companies that use the trading name Summit. The request contains no information that distinguishes them, and no default account is configured. The agent must create the task for the intended contact without guessing. What should the agent do next?

Show answerCORRECT ANSWER

Ask the salesperson to choose between the matching contacts using permitted identifying details, then invoke the task-creation tool with the selected contact's identifier.

An agent can pause a multistep task to obtain missing information. Asking for clarification resolves the ambiguity before the agent requests a change through an authorized CRM tool.

Practice Tool Use in a full exam

Questions on Tool Use in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Tool Use

3 min read

Tool use connects a foundation model to capabilities outside its learned parameters. A tool might look up an order, calculate a tax amount, search documents, create a support ticket, or reserve inventory. The model receives descriptions of available tools and their expected inputs, then can request an appropriate operation. The application or agent runtime executes the operation and returns its result to the model, which can explain the outcome or request another operation.

A typical interaction begins with a user asking, “Where is my shipment?” The application provides a tool definition for retrieving shipment status, including a structured input schema. The model requests that tool with an order identifier. Application code verifies the identifier and the user's authorization, calls the shipping system, and passes the response back to the model. The model then produces an answer grounded in the returned status rather than guessing from its training data. Generating a tool request is not the same as executing it successfully.

Tool use is a building block of AI agents. An agent combines a model with instructions, tools, and orchestration logic to pursue a goal through potentially multiple steps. For example, a customer-service agent could retrieve an order, check refund eligibility, request approval, and submit an authorized refund. Other business applications include scheduling appointments, investigating operational incidents, reconciling invoices, and checking inventory before preparing a sales quote. A single tool call does not necessarily make an application an autonomous agent; agent behavior depends on how it selects and coordinates actions toward a goal.

In cloud applications, tools commonly run as serverless functions, containerized services, or authenticated API endpoints. Tool definitions should describe purpose, required parameters, acceptable values, and possible results clearly. Prefer narrowly scoped business operations, such as retrieving an authenticated customer's orders, over unrestricted database queries or arbitrary command execution. Keep credentials in the execution environment rather than placing them in prompts, and enforce identity and authorization outside the model.

Security boundaries are essential because a model's proposed arguments are untrusted input. Validate schemas and business rules, restrict network destinations, and apply least-privilege permissions. Retrieved content and tool responses can contain prompt-injection attempts, so they must not be allowed to redefine tool permissions or approval requirements. High-impact actions, such as transferring money or deleting resources, should require explicit approval enforced by the application. Generated confirmation text alone is not evidence of authorization.

Tool use introduces latency, inference charges, API costs, and additional failure modes. Set timeouts, limit the number of tool calls, handle unavailable dependencies, and use bounded retries. Write operations need idempotency controls to prevent repeated requests from creating duplicate refunds or reservations. Record tool selections, validated arguments, execution outcomes, and approvals with appropriate protection for sensitive data. Evaluate both task completion and whether the application chose safe, appropriate actions.

Tool use does not retrain the model, guarantee factual answers, or automatically grant access to enterprise systems. Retrieval-augmented generation supplies external information for generating answers; retrieval can itself be exposed as a tool, but tools also support calculations and state-changing operations. For predictable, fixed procedures, a deterministic workflow may be simpler and safer than allowing a model to choose every step. Use agentic selection where flexibility provides a clear business benefit, while retaining deterministic controls around execution.

Learn Tool Use in lessons

5 short lessons on Tool Use in 3 certification courses.

Open the lessons