generate-document is exposed as a tool, an AI agent can call it.
Let’s add an agent and a skill so users can just say “generate a proposal for
Jeffery Griffin”.
The skill
A skill is reusable instructions — knowledge you attach to agents. Ours teaches the model how to use the tool.The agent
An agent pairs a prompt with a model. SetresponseFormat explicitly to avoid a build warning.
The agent can only call the tool if its role allows it. We already set
canAccessAllTools: true and canBeAssignedToAgents: true on the app’s role in
Chapter 2.Try it
Open a chat with Document Assistant and ask it to draft a document for a person in your CRM. It finds the record, callsgenerate-document, and reports
back the document it created — which now appears in your Documents view,
exactly like the command-menu and workflow paths.
That’s the payoff of exposing logic as a tool: one function, many front doors —
command menu, HTTP, workflow step, and now natural language.
After this step: the app is feature-complete and genuinely useful. Time to
ship it.
Next: publishing →
Add marketplace metadata and publish.