10.4 Add REST APIs to an Agent
Key Takeaways
- REST API tools require an OpenAPI specification, authentication configuration, and high-quality natural-language descriptions so the orchestrator knows when to call each operation.
- Copilot Studio expects OpenAPI v2 processing behavior; v3 uploads are translated to v2 during creation.
- Auth options include None, API key (header or query), and OAuth 2.0 with client ID/secret, authorization/token/refresh URLs, scopes, and organization access controls.
- Select only the HTTP operations the agent should expose; configure per-tool names and descriptions; complete blank parameter descriptions before publishing.
- After publish, create connections and Add and configure each selected operation; then use Details/Inputs/Completion patterns and runtime testing for errors and orchestration quality.
Why REST API tools matter on AB-620
Add REST APIs to an agent completes the tools quartet with a first-class path for OpenAPI-described HTTP services. Where custom connectors emphasize Power Platform connector lifecycle, the REST API tool wizard focuses on turning a specification into one or more agent tools quickly—still with authentication, descriptions, and solution awareness.
What you must provide
Microsoft documents three essentials to connect a REST API:
- An OpenAPI specification defining functions and available actions.
- Authentication type and details so users or the agent can access the API.
- Descriptions that help the language model decide when to invoke each operation.
You can add REST API tools to custom agents and to agents that extend Microsoft 365 Copilot experiences; the add process is the same at a high level.
Specification rule: create REST API tools from an OpenAPI v2 specification because of how Power Platform processes API specs. If you submit v3, creation automatically translates it to v2. Prefer cleaning the spec before upload so translation surprises (unsupported constructs) do not appear only at runtime.
End-to-end wizard steps
| Step | Goal |
|---|---|
| 1. New tool → REST API | Start from agent Overview Tools or Tools tab → Add tool |
| 2. Upload specification, description, solution | JSON OpenAPI file; improve description; pick solution for ALM |
| 3. Authentication details | None, API key, or OAuth 2.0 field sets |
| 4. Select tools from the API | Choose methods/endpoints; configure names/descriptions; fill parameter descriptions |
| 5. Review and publish | Publish plugin/tools; create connections; Add and configure onto the agent |
1) Start REST API tool creation
From the agent Overview Tools section or Tools tab: Add tool → New tool → REST API.
2) Specification, description, and solution
Upload the OpenAPI JSON (drag-and-drop or browse). Verify detected details.
On API plugin details:
- Description is prefilled from the spec but is often too thin for orchestration. Expand with verbs and synonyms. Example: weak — “A simple service to manage tickets.” Stronger — “Get, retrieve, find, and display existing tickets from SunnyADO; update and manage ticket fields to improve records.”
- Solution — select an environment solution for ALM. Preferred/default solutions may auto-select; if left blank, the platform can create a solution using the action name and default publisher. Storing actions in solutions makes movement across environments tractable. Prefer a custom solution over relying only on default CDS solutions when managing enterprise ALM.
3) Authentication details
| Method | When to use | Key fields |
|---|---|---|
| None | Open APIs without credentials | No extra fields |
| API key | Key in header or query | Parameter label, parameter name, location (Header or Query). At runtime the agent can prompt the user for the key when needed |
| OAuth 2.0 | User-delegated access via identity provider | Client ID, client secret, authorization URL, token URL, refresh URL, optional scope; org access (my organization only vs any Microsoft 365 orgs); app/client GUID constraints as presented in the UI |
OAuth lets users grant permissions without sharing their primary credentials with the agent. API key is simpler but weaker for per-user enterprise authorization. None is rare in production LOB systems.
4) Select and configure tools (operations)
A REST API exposes many endpoint + method combinations (GET/POST/PUT/DELETE…). You often must not enable every operation. Example: allow create and read, but not delete, for a helpdesk agent.
For each selected tool:
- Open Configure your tool.
- Set Tool name and Tool description (specific enough for model routing).
- Review parameters page — inputs and outputs come from the spec; you generally cannot change schemas here, but you must supply missing descriptions. Blank descriptions block progress; paste the parameter name as a last resort, but prefer human meaning (“work item id from Azure Boards”).
- Return to selection list; add more operations; continue when the agent’s surface area is correct.
5) Review, publish, connect, attach
Review summary → publish (wait for completion) → Create connection → back on Add tool, filter REST API → for each operation, select connection (or create) → Add and configure.
Each selected API operation appears as its own tool entry. Use search to find them in large agents.
Descriptions as orchestration contracts
Generative orchestration selects tools using names, descriptions, conversation context, and available inputs/outputs. For REST tools:
- API-level description orients the overall system.
- Operation-level description disambiguates GET list vs GET by id vs POST create.
- Parameter descriptions improve dynamic fill and reduce wrong ID formats.
After attachment, still use the common tool pages:
- Dynamic vs custom input fill
- Ask before running for high-impact POSTs
- Completion behavior (model-written response vs fixed template)
- Enable/disable dynamic decision so some operations stay topic-only
Error handling and operational readiness
REST tools fail for reasons that appear on exams and in labs:
| Failure class | What to verify |
|---|---|
| Spec/import | Valid JSON; v2-friendly constructs; translation from v3 not dropping operations |
| Auth | Correct key location; OAuth URLs; client secrets; consent; org restrictions |
| Connection | Connection created after publish; user can create connection in channel |
| Orchestration | Descriptions too vague so tool never selected; or too broad so wrong POST fires |
| Runtime HTTP | 401/403 permissions; 404 wrong path; 429 throttling; 5xx backend |
| Policy | Environment DLP / connector governance on the generated API connector assets |
| Timeouts | Long-running APIs may need backend async patterns rather than chat-blocking calls |
Maker practice: test with representative prompts in agent test chat, inspect Activity for which tool was chosen, and refine descriptions before blaming the API. For explicit process control, call the REST tool from a topic Action after validating inputs in dialogue.
Scenario: SunnyADO ticket API (exam-style)
SunnyADO exposes OpenAPI for tickets. Product wants employees to list and update tickets in Teams via an agent, but not delete tickets.
- Export OpenAPI; if v3, accept translation to v2 or publish a cleaned v2.
- New tool → REST API → upload → rewrite description with retrieve/update synonyms.
- Place in Fabrikam Agents solution for ALM.
- Choose OAuth 2.0 against the corporate IdP so each employee’s ticket scope is honored.
- Select
GET /tickets,GET /tickets/{id},PATCH /tickets/{id}only—omitDELETE. - Fill every blank parameter description (
id→ “Unique SunnyADO ticket identifier”). - Publish, create connections, Add and configure each operation.
- Set ask-before-run on PATCH; leave GETs automatic.
- Test: “Show my open tickets” should hit list; “Close ticket 1234” should confirm then PATCH; “Delete ticket 1234” should not find a delete tool.
REST vs custom connector vs MCP vs computer use (final comparison)
| Criteria | REST API tool | Existing custom connector | MCP | Computer use |
|---|---|---|---|---|
| Primary artifact | OpenAPI upload in agent wizard | Connector already in environment | MCP server catalog | Natural-language GUI instructions |
| Catalog dynamics | Static until you re-import/update | Connector versioning/ALM | Dynamic server updates | Instruction-driven, not OpenAPI |
| Best reuse across PA/Apps | Indirect (may create connector-like assets) | Excellent | Via MCP connector | N/A |
| Auth UX in wizard | None / API key / OAuth 2.0 | Connector connection UX | MCP connection authorize | Machine + stored site credentials |
| When API missing | Not applicable | Not applicable | Not applicable | Preferred |
Exam checklist
- List the three requirements: OpenAPI, auth, descriptions.
- Remember v2 processing and v3 auto-translation.
- Walk the five wizard stages without skipping parameter descriptions.
- Choose auth scheme from scenario cues (public vs key vs user OAuth).
- Subset operations intentionally for least privilege.
- After publish, still create connections and attach tools; then tune orchestration descriptions and completion behavior.
- Diagnose failures by layer: spec, auth, connection, orchestration selection, HTTP, policy.
Which three elements does Microsoft call out as required to connect an agent to a REST API as tools?
A maker uploads an OpenAPI 3.0 JSON file while creating a REST API tool. What does Copilot Studio’s creation process do regarding specification versions?
During REST API tool setup, the parameter review page shows an input with an empty description. What should the maker do before they can proceed?