Ways to give an agent custom capabilities
Custom tools let a Foundry agent interoperate with your applications, external APIs, and services. There are four options, chosen by the nature of the integration.
| Option | Best for | How |
|---|---|---|
| Custom function | Custom business logic, language flexibility | Describe a function's structure; the agent calls it with arguments. |
| Azure Functions | Event-driven, serverless workflows | Triggers determine when it runs; bindings connect input/output data. |
| OpenAPI specification | External REST APIs | An OpenAPI 3.0 spec describes the HTTP API for standardized integration. |
| Azure Logic Apps | Low/no-code workflow orchestration | Visually connect apps, data, and services without advanced code. |
Register, then let the agent decide
Integration follows one shape regardless of option: define the capability, register it via a Foundry tool object, add it to the agent's tools, and the agent autonomously invokes it when the prompt calls for it.
Key concept · The three integration methods
- Function calling — write a Python function with clear parameters, register it via
FunctionTool(name, parameter schema, description); the agent decides when to call. - Azure Functions — deploy the function, define input/output bindings, register via
AzureFunctionTool; the agent sends requests through the bindings. - OpenAPI — create a JSON OpenAPI 3.0 spec, register via
OpenApiTool(auth: anonymous, API key, or managed identity); the agent calls the external API per the spec.
Key concept · The declarative pattern
The critical rule: don't manually call custom tools in code. Instead, give tools meaningful names and well-documented parameters and let the agent autonomously decide when and how to call them. Good descriptions are what let the agent "figure out" tool usage — the declarative approach is what makes it intelligent.
Chapter 8 quiz
Thirteen questions on the custom-tool options and how to integrate them. Answer first, then expand Show answer.
Part A · Multiple choice
Which custom-tool option is best for integrating an external REST API in a standardized way?
- A Custom function
- B OpenAPI specification
- C Azure Logic Apps
- D Azure Functions
Show answer
B — OpenAPI specification. An OpenAPI 3.0 spec standardizes the HTTP API integration.
Which option is event-driven, using triggers and bindings?
- A Azure Functions
- B Custom function
- C OpenAPI
- D Logic Apps
Show answer
A — Azure Functions. Triggers decide when it runs; bindings connect data sources.
Which option is a low/no-code way to orchestrate multiple apps and services?
- A Custom function
- B OpenAPI
- C Azure Logic Apps
- D Azure Functions
Show answer
C — Azure Logic Apps.
To register a Python function as a tool, you use:
- A
FunctionTool(name, parameter schema, description) - B A vector index
- C A content filter
- D A Logic App
Show answer
A — FunctionTool. The agent decides when to call it based on the description.
Which auth types does the OpenAPI tool support?
- A Anonymous, API key, and managed identity
- B Password only
- C None
- D Biometric
Show answer
A. Registered via OpenApiTool with the chosen auth details.
What is the key rule of the declarative tool pattern?
- A Manually call each tool in code
- B Describe tools well and let the agent decide when to call them
- C Use only one tool per agent
- D Disable tool descriptions
Show answer
B. Meaningful names and documented parameters let the agent choose autonomously.
Part B · True or false
You should manually orchestrate every custom-tool call in your code.
Show answer
False. The declarative pattern has the agent decide — you just define and register the tools.
A custom function tool supports multiple programming languages.
Show answer
True. Custom functions offer language flexibility for business logic.
Azure Functions register with an agent via an AzureFunctionTool and use input/output bindings.
Show answer
True. The agent sends requests through the specified bindings.
Well-documented parameters and names help the agent invoke tools correctly.
Show answer
True. The description is what guides the agent's decision to call.
Part C · Short answer
Name the four custom-tool options.
Show answer
Custom function, Azure Functions, OpenAPI specification, and Azure Logic Apps.
Name the three tool objects used to register custom tools.
Show answer
FunctionTool, AzureFunctionTool, and OpenApiTool.
Which option would you choose for tightly-integrated custom business logic?
Show answer
A custom function — for custom logic and language flexibility.