Skip to main content
Post

#PowerPlatformTip 173: 'Let Copilot Studio Build the Call - Your Connector as an AI Tool'

#PowerPlatformTip 173: 'Let Copilot Studio Build the Call - Your Connector as an AI Tool'

TL;DR: Add your Custom Connector (#172) to a Copilot Studio agent on the Tools page with Add a tool. Generative orchestration reads the operation names and descriptions, picks the right operation and fills the inputs from the conversation (Dynamically fill with AI). The credential stays on the connection, so the agent never sees the key. The catch: it’s a tool + an instruction, not Knowledge. Custom connectors are premium.

Once your API lives in a Custom Connector, the real payoff arrives: give it to a Copilot Studio agent as a tool and let the AI find and call the right endpoint on its own. You don’t wire a separate topic per endpoint, you hand over the definition once and generative orchestration assembles each call from the conversation. It behaves like a hand-rolled MCP server for any API that doesn’t ship one.

💡 Challenge

You want an agent that answers “list my open projects” or “how many hours did I log this week” by calling the right endpoint of your time-tracking API (MOCO in this example) on its own. Building a topic with a separate action for every endpoint is tedious and never keeps up with the API. And there’s a conceptual trap: people drop the API definition into Knowledge and wonder why the agent can’t actually call anything.

✅ Solution

Add the connector once as a tool, invest in descriptions, and let generative orchestration select the operation and fill the parameters from the user’s intent. Steer the edge cases with a short agent instruction, not with Knowledge, which is lookup only and can’t execute. If the service already ships an MCP server, prefer that; this connector pattern is the fallback when it doesn’t.

🔧 How It’s Done

1. Pick the connector shape.

🔸 Typed operations (preferred): import the vendor’s OpenAPI definition into the custom connector. Every endpoint becomes its own operation with its own description and typed inputs, so the orchestrator has the most to go on.

🔸 One generic operation: the connector from #172 (MocoRequest with relativePath and body) is the fallback when there is no usable OpenAPI file. Then the endpoint knowledge has to come from the descriptions and the instruction in step 3.

🔸 Use one of the two for a given API, not both side by side, otherwise the agent has two tools for the same job.

2. Add the connector as a tool.

🔸 Open the agent, go to Tools and select Add a tool. Search for your custom connector, pick the operation and create or select the connection.

🔸 The custom connector must be shared so that the agent and its users can use it.

🔸 On the tool’s Details, write a clear Description: generative orchestration relies on it to decide when to use the tool. Under Authentication choose Maker-provided credentials for one shared API key, or End user if every user signs in with their own account.

🔸 Under Inputs, keep Fill using on Dynamically fill with AI and describe each input, for example relativePath: MOCO endpoint, e.g. projects for projects, activities for time entries.

🔸 For write operations, set Ask the end user before running to Yes.

3. Steer it with an agent instruction (not Knowledge).

🔸 Add a short instruction that references the tool with /, for example “When the user asks about MOCO time or projects, use /MocoRequest, build relativePath and body from the endpoints listed here.”

🔸 With the generic operation, list the endpoints the agent may use in that instruction. Keep the list short. With typed operations the descriptions already carry this, so the instruction only needs the rules.

🔸 Don’t add the API definition as a Knowledge source: Knowledge is used to answer questions, it can’t execute a call or hold behavior.

4. Test in the test pane.

🔸 Generative orchestration is on by default. Open Test your agent and ask: “List my open MOCO projects.”

🔸 Open the activity map of the response and check the tool call: the projects operation was chosen (or relativePath points to the projects endpoint) and no body was sent.

🔸 Then ask: “Log 2 hours on project X for today.” The agent asks for confirmation before running; check the generated body in the tool inputs before you confirm.

5. Know the limits.

🔸 A connector response can be at most 5 MB in public cloud (450 KB in GCC). Larger results fail with the output returned from the connector was too large. Use query or limit inputs to keep lists small.

🔸 Generative orchestration supports up to 128 tools per agent; Microsoft recommends 25 to 30 for best results. A single generic operation keeps you far below that.

🔸 A failing call (for example 404 or 422) surfaces as an error such as HTTP422UnprocessableEntity instead of data the model can work with. To let the agent recover and retry, wrap the call in a flow, that’s #PowerPlatformTip 174.

🎉 Result

The agent picks the endpoint and builds the request from one connector definition. New API areas need no new topic, just better descriptions. Auth stays on the connection, and the whole thing behaves like a hand-rolled MCP for APIs that don’t ship one.

🌟 Key Advantages

🔸 AI builds the call: operation and inputs come from user intent; the auth is fixed on the connection.

🔸 MCP-style discovery without MCP: one tool exposes the API, the agent picks the operation itself.

🔸 Set the key once: with maker-provided credentials nobody re-enters or sees the key.

🔸 No per-endpoint wiring: descriptions, not topics, drive coverage.

🔸 Ready to self-heal: pair it with the flow wrapper in #PowerPlatformTip 174.

🛠️ FAQ

1. How does the AI know which endpoint to call?

From the tool name and description, the input names and descriptions, the conversation and the user’s intent. Vague descriptions lead to the wrong operation or a malformed body, so invest in them.

2. Should I add the API definition as Knowledge or as a tool?

As a tool. The tool carries the definition and can execute it. Knowledge is for answering questions, it can’t run the call. Put the “when X, do Y” behavior in an agent instruction that references the tool with /.

3. Should I use this or an MCP server?

If the service offers an MCP server, prefer it: Tools > Add a tool > Model Context Protocol, and the agent discovers the server’s tools itself. This custom-connector pattern is the fallback when there is no MCP server.

4. Does “authenticate once” really hold for every user?

Only with Maker-provided credentials. With End user authentication each user is asked to sign in or create a connection once. Either way, nobody re-enters the key per call.

This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy, which runs free live workshops (in German). See the next free workshop dates (in German). For companies that want this implemented for them, see KMUpower: Power Platform consulting & automation for SMEs (DACH).

This post is licensed under CC BY 4.0 by the author.

Microsoft and the Power Platform product names (for example Power Apps, Power Automate, Copilot Studio) are trademarks of the Microsoft group of companies. This is an independent website. It is not operated, sponsored or endorsed by Microsoft.