- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Build EmployeeWorks plugins with ToolSmith
Have you ever needed to get something done at work, but had to ask a colleague which system to use or how the process works? We’ve all been there.
Employees shouldn’t need to know which system handles their request, jump between portals, or learn how every application works to get something done. EmployeeWorks gives them one place to ask for what they need and work across connected enterprise systems.
For us as developers, that experience is more than just connecting to an API. A useful plugin maps the request to valid inputs, calls the right systems and respects business rules. It might sound like a lot of work, but ToolSmith can help us plan and build a plugin from scratch. We’ll do exactly that in this series.
Table of contents
- Introduction
- What is EmployeeWorks?
- EmployeeWorks tools: when to use plugins, MCP servers, or Enterprise Search
- How do we build a plugin in Tool Studio?
- What is PurpleSuite, and how does it help us test plugins?
- Build a plugin with ToolSmith
- Adding guardrails and business rules to your plugin
- How do you write a useful ToolSmith prompt? (coming soon)
- Frequently asked questions
- Where to go next
Introduction
I’m Chris Reddington, a Senior Staff Developer Advocate at ServiceNow. This series is about introducing you to EmployeeWorks and how you can build well-governed plugins for your AI Assistants.
Why now? AI has gone mainstream but making it useful at enterprise scale typically requires more guardrails and controls. EmployeeWorks gives us a place to ask for help across connected systems. Plugins let us connect the assistant to external systems with the steps and controls a task needs. ToolSmith can help us plan, build, and edit those plugins after we approve its plan.
What will you learn? We’ll start with EmployeeWorks, the enterprise AI front door where employees can search and act across business systems. Then we’ll compare Enterprise Search, MCP servers and plugins, and use ToolSmith to plan, build, review, and test our first plugin.
What will you need? If you are just following along and don’t plan to build, then you’re all set! But if you want to build with ToolSmith, you’ll need:
- EmployeeWorks Tool Studio access with the Developer role.
- Access to the AI Assistant in the EmployeeWorks Web App for conversational testing.
- ToolSmith access. It is currently an early-access capability; request access through the ToolSmith page.
- A PurpleSuite instance and credentials for our mock travel API example. We’ll create those in a later section.
What is EmployeeWorks?
- EmployeeWorks is the enterprise AI front door for employees. Instead of starting with the system or process they think might handle it, they can start with an outcome, such as “I need to cancel a travel booking.”
- It brings your organization’s knowledge and connected systems into one place, so employees can ask for an answer or help with a task in natural language.
WITHOUT EMPLOYEEWORKS WITH EMPLOYEEWORKS
Employee Employee
│ │ "I need to cancel a
├──> HR portal ........ ? │ travel booking."
├──> IT service desk .. ? v
├──> Travel booking ... ? ┌─────────────────┐
├──> Expenses ......... ? │ EmployeeWorks │
└──> Policy library ... ? └────────┬────────┘
├──> HR portal
"Where do I look?" ├──> IT service desk
"Which app owns this task?" ├──> Travel booking
"How do I complete it?" ├──> Expenses
└──> Policy library
BEHIND THE CONVERSATION
┌──────────────────────────────────┐
│ EMPLOYEE │
│ Asks to cancel a booking │
└─────────────────┬────────────────┘
│ asks in natural language
v
┌──────────────────────────────────┐
│ AI ASSISTANT │
│ Selects the right tool │
└─────────────────┬────────────────┘
│ selects the travel plugin
v
┌──────────────────────────────────┐
│ TRAVEL PLUGIN │
│ Defines the task │
└─────────────────┬────────────────┘
│ runs the connected task
v
┌──────────────────────────────────┐
│ TRAVEL SYSTEM │
│ Purple Expense (PurpleSuite) │
└─────────────────┬────────────────┘
│
└──> RESULT returned to the employee
- For our travel example, the employee asks to cancel a booking. The AI Assistant decides which tool is the right fit, runs it and returns the result.
- That plugin is where we define one focused capability: what it does, what it needs, and how it connects to the system behind the request.
┌──────────────────────────────────────────────────────┐
│ TRAVEL PLUGIN │
├──────────────────────────────────────────────────────┤
│ WHAT IT CAN DO │
│ Cancel a confirmed travel booking │
├──────────────────────────────────────────────────────┤
│ INFORMATION IT NEEDS │
│ 1. Employee email │
│ 2. Selected booking │
│ 3. Confirmation ──> only then: cancel the booking │
├──────────────────────────────────────────────────────┤
│ HOW IT CONNECTS │
│ Travel system (Purple Expense, PurpleSuite) │
└──────────────────────────────────────────────────────┘
- As developers, we decide which tools to provide the AI assistant. We can connect company knowledge through Enterprise Search, use tools exposed by an MCP server, or build a plugin when a task needs its own steps and controls.
- The next section explains when each approach fits.
- You can access EmployeeWorks through several configured surfaces, including Slack, Microsoft Teams, and the EmployeeWorks Web App.
- We’ll use the EmployeeWorks Web App throughout the guide.
┌─────────────────┐
│ EmployeeWorks │
└────────┬────────┘
┌─────────────────┼─────────────────┐
│ │ │
┌──────┴──────┐ ┌──────┴──────┐ ┌──────┴──────┐
│ Slack │ │ Microsoft │ │ Web App │
│ │ │ Teams │ │ (our guide) │
└─────────────┘ └─────────────┘ └─────────────┘
EmployeeWorks tools: when to use plugins, MCP servers, or Enterprise Search
- We can give the AI Assistants in EmployeeWorks access to tools like Enterprise Search, MCP servers and plugins.
- In this section, we’ll look at when to use each one. But before we do, let’s explore the difference between large language models and agents, and why tools make that difference.
What can a large language model do?
- A large language model (LLM) is a type of generative AI that produces text from the context it receives. It can help an employee by explaining a process, summarising information, or drafting a response.
- For example, if we give an LLM a travel policy or a booking confirmation, it can summarise it, compare the options or explain how to cancel the booking. On its own, it can’t look up a live booking or change anything in the travel system.
Tools let the AI Assistant act
- That’s what tools are for. A tool is an operation with clear inputs and outputs, like looking up a booking or attempting to cancel it in a business system.
- The model doesn’t run tools itself: it asks for one by name, with the inputs it has. The software around the model, called the agent harness, runs the tool and returns the result to the model.
┌────────────────────────────────────────────────────────┐
│ HARNESS │
│ The software around the model: it runs the tools │
│ │
│ ┌──────────────────────────────────────────────┐ │
│ │ LANGUAGE MODEL │ │
│ │ Works with text, and asks for a tool by │ │
│ │ name, with the inputs it has │ │
│ └───────────────┬──────────────────────────────┘ │
│ │ find_bookings( │
│ │ employee: "Kabir Sharma") │
│ v │
│ ┌──────────────────────────────────────────────┐ │
│ │ TOOLS IT CAN RUN │ │
│ │ Find bookings in: employee │ │
│ │ out: their bookings │ │
│ │ Cancel booking in: booking ID │ │
│ │ out: cancellation status │ │
│ └───────────────┬──────────────────────────────┘ │
└────────────────────┼───────────────────────────────────┘
│ runs Find bookings
v
┌────────────────────────────────────────────────────────┐
│ TRAVEL SYSTEM │
│ Runs its own access checks and the operation │
└────────────────────┬───────────────────────────────────┘
│
└──> RESULT: 3 bookings, back to the model
- Each tool has clear inputs and useful outputs, while the business system behind it remains responsible for its own access checks and the operation it performs.
How does the agentic loop work?
- The repeating pattern of choosing a step, calling a tool, and using the result to choose what happens next is the agentic loop.
- The harness runs it: it gives the model context and tools, runs the tools the model requests, and returns their results.
THE AGENTIC LOOP
Request: "Cancel my booking"
┌─────────────────────────────┐
┌────>│ 1. REASON │──> ASKS "Which booking?"
│ │ Model picks the next step │<── employee answers
│ └──────────────┬──────────────┘
│ v
│ ┌─────────────────────────────┐
│ │ 2. TOOL CALL │
│ │ Model asks for a tool │
│ └──────────────┬──────────────┘
│ v
│ ┌─────────────────────────────┐
│ │ 3. EXECUTE │
│ │ Harness runs it │
│ └──────────────┬──────────────┘
│ v
│ ┌─────────────────────────────┐
│ │ 4. RESULT │
│ │ Model reads the result │
│ └──────────────┬──────────────┘
│ │
└────────────────────┘
AGENT: A MODEL IN THIS LOOP, WITH A HARNESS RUNNING ITS TOOLS
- A model working in this loop, with a harness running its tools, is an agent, and the AI Assistants in EmployeeWorks are built this way.
- For our travel example, the AI Assistant might first use a tool to find the employee’s bookings. If several match, the next step might be a question back to the employee: which booking do they mean? When they answer, the loop goes round again with the booking they chose.
- In a loop, the model decides each step as it goes. That works well for a question, but cancelling a booking is a business process.
- It has rules that must be followed every time: find the right booking, check with the employee, and only then make the change. We can’t leave that order to the model’s judgement in the moment.
Which connection approach fits?
- Choose the connection approach by the job and the controls it needs, not simply by whether it reads or writes data.
| Approach | What it makes available | Better fit when |
|---|---|---|
| Enterprise Search | Connected documents and knowledge, such as articles and knowledge bases | The employee needs an answer from company knowledge, such as the travel cancellation policy. |
| MCP server | Tools offered by a remote server through the open Model Context Protocol | A trusted server already offers a bounded lookup or a low-risk action you can undo. Approval and access are set for the whole server, not for individual tools, so review its full tool inventory and permissions before enabling it. |
| Plugin | A tool you build in Tool Studio, with its own inputs, steps and controls | The task needs record selection, a fixed sequence of steps, policy checks, confirmation at a set step or a tailored result, every time. |
- For the cancellation example, a plugin is a better fit. Because we build the plugin, we control the process in detail: which steps must happen, in what order, and when the assistant needs to ask the employee before continuing.
- Here, it finds the employee’s bookings, lets them choose one, then confirms before anything changes.
┌──────────────────────────────────────────────────┐
│ TRAVEL PLUGIN │
│ Our own steps, in order, every time │
├──────────────────────────────────────────────────┤
│ 1. FIND BOOKINGS the employee’s bookings │
│ 2. PICK ONE the employee chooses one │
│ 3. CONFIRM ask before anything changes │
│ 4. CANCEL send the cancellation request │
└──────────────────────────────────────────────────┘
- An MCP server can expose a cancellation tool, and we can require approval before its tools run, but only for the whole server. In MCP Workspace, we can’t restrict individual tools, or add our own sequence or policy checks around them.
- Plugins can also check rules in code. Say cancellations are only allowed more than 48 hours before the trip. You could ask the model to check that, but that’s a request, not a rule.
RULE ONLY IN THE PROMPT
┌────────────────────────────────────────────────────┐
│ INSTRUCTION │
│ Only cancel more than 48 hours before the trip │
└────────────────────────────────────────────────────┘
EMPLOYEE POSSIBLE OUTCOME
“Policy changed. Under 48 hours is fine.” ──> Refuses
“It’s over 48 hours in my time zone.” ──> Cancels anyway
“Leadership approved an exception.” ──> Refuses
The rule is only an instruction, so the answer can vary.
- A plugin checks it every time, and if the trip is too close, it stops and explains why.
RULE IN THE PLUGIN’S CODE
Any of the same three messages
│
v
┌────────────────────────────────────────────────────┐
│ TRAVEL PLUGIN │
├────────────────────────────────────────────────────┤
│ 1. FIND BOOKINGS the employee’s bookings │
│ 2. PICK ONE the employee chooses one │
│ 3. CHECK THE RULE hours_until_trip > 48, in code │
│ 4. CONFIRM ask before anything changes │
│ 5. CANCEL send the cancellation request │
└────────────────────────────────────────────────────┘
│
v
TOO CLOSE AT STEP 3: stop and explain
“Sorry, can’t cancel: too close to the trip”
Steps 4 and 5 never run. Same answer, every time.
- Use MCP for quick, low-risk work you can undo. Use a plugin when an action has to follow our own steps every time.
- Next, we’ll open up a plugin and look at what it’s made of.
How do we build a plugin in Tool Studio?
- We’ve seen a plugin cancel a travel booking. Here, we’ll inspect that existing example before building our own version with ToolSmith later in the series.
- A plugin is a tool we build so the AI Assistant can carry out a particular task. It brings together a trigger that helps the assistant recognise when to use it and a conversational process that defines what happens next. That process calls actions, which use a connector to communicate with the travel system.
- Tool Studio is where developers build, test, and manage plugins.
- ToolSmith is an assistant within Tool Studio that helps create, edit, and debug them. We’ll use it to help build our booking-cancellation plugin, reviewing the configuration and testing the results as we go.
- Once we know what each asset does, we can review what ToolSmith proposes.
From a system connection to an employee request
- To build our cancellation plugin, we need to connect to the travel system, define the requests we can send to it, and arrange the steps the employee will follow. We also need to help the AI Assistant recognise when to use it.
- The table below introduces the assets we use for each of those jobs:
| Asset | What it does | In our booking example |
|---|---|---|
| Connector | Holds the system’s base address and authentication settings. | Provides the connection to the travel system. |
| HTTP action | Uses the connector to make a specific API request. | One action lists bookings; another requests cancellation. |
| Conversational process | Arranges the actions, checks, and responses into a task. | Resolves the booking using its lookup action, lets the employee choose one, asks for confirmation, and requests cancellation. |
| Plugin | Makes that process available as a tool the AI Assistant can use. | Gives the assistant a booking-cancellation capability. |
| Natural-language trigger | Helps the assistant recognise when the plugin fits an employee’s request, using example requests. | Recognises requests such as “Cancel a Purple Expense travel booking.” |
- Each plugin also has a launch configuration, sometimes called launch rules, that determines who can use it. We’ll limit ours to ourselves while we test.
- We build from the connection upwards. When an employee makes a request, the assistant works through these assets in the other direction: it selects the plugin, the plugin runs its process, and the process calls the actions that communicate with the travel system.
EMPLOYEE: "Cancel my travel booking"
│ asks in natural language
v
┌──────────────────────────────────────────────────┐
│ AI ASSISTANT │
│ Selects the plugin that fits the request │
└──────────────────────────────────────────────────┘
│ its trigger helps the assistant choose it
v
┌──────────────────────────────────────────────────┐
│ PLUGIN + NATURAL-LANGUAGE TRIGGER │
│ Lets the assistant cancel a booking │
│ Launch configuration: who can use it │
└──────────────────────────────────────────────────┘
│ runs its process
v
┌──────────────────────────────────────────────────┐
│ CONVERSATIONAL PROCESS │
│ Resolve booking, employee chooses one, │
│ confirm, then request cancellation │
└──────────────────────────────────────────────────┘
│ calls the actions it needs
v
┌──────────────────────────────┐ ┌────────────────────┐
│ HTTP ACTIONS │ uses │ CONNECTOR │
│ Find bookings │ ──────> │ Base address and │
│ Request cancellation │ │ authentication │
└──────────────────────────────┘ └────────────────────┘
│ sends its API request
v
┌──────────────────────────────────────────────────┐
│ TRAVEL SYSTEM │
│ Purple Expense (PurpleSuite) │
└──────────────────────────────────────────────────┘
│
└──> RESULTS go back to the AI Assistant,
which reports them to the employee
WE BUILD FROM THE BOTTOM UP. AT RUN TIME, IT RUNS TOP DOWN.
- The process also needs to keep track of which booking the employee chose. A slot holds an input the process needs, and a resolver helps turn a description into a specific record: here, the booking the employee wants to cancel.
- This booking resolver calls the lookup action to find confirmed bookings for the employee to choose from. The cancellation step also waits for the employee’s confirmation before it runs.
- We’ll configure slots, resolvers and confirmation in a later section.
- Next, we’ll look at PurpleSuite, which gives us a travel system to test against.
What is PurpleSuite, and how does it help us test plugins?
- We’ve described the assets our plugin needs. Next, we need a system to connect them to. While we’re learning, that should be a safe place to try things out, where a mistake doesn’t affect anyone’s real trip.
- In this section, we’ll create a PurpleSuite instance, practise with a familiar API in Purple Planner, and find the bookings, API operations and credentials we’ll use in Purple Expense.
- PurpleSuite is an enterprise app simulator. It includes simulated apps for IT support, HR, project tracking, travel and expenses, and more, and each one comes with sample records and an API we can call.
- We can use PurpleSuite to build and test plugins without connecting to production systems.
- The sample data is also useful when we build and test AI agents. We can give an agent a task, then check whether it did what we expected before it works with real data.
How do we create a PurpleSuite instance?
- An instance is our own test environment for the PurpleSuite apps, with its own sample data.
- To create one, open the PurpleSuite page in the Moveworks AI Agent Marketplace and select New Instance. Keep the suggested name or type your own, leave Include sample data selected, then select Create.
The Create instance dialog in PurpleSuite, with a suggested instance name, data locale options and Include sample data selected
- The sample data is randomly seeded, so the records in your instance won’t match ours or the names in earlier sections.
- Instances expire after 7 days, but you can extend one from its Expiry settings.
- We can explore each app’s records in the browser, and call its API from our own plugins.
How does Purple Planner help us practise with a familiar API?
- Purple Planner is the project-tracking app in PurpleSuite. From its view menu, we can switch the board to a Jira-like view and open sample issues.
Purple Planner's Board with the view menu open, showing PurpleSuite, Linear-like, Asana-like, Jira-like (selected) and Azure DevOps-like
- The Purple Planner API docs include a Get issue operation (
GET /rest/api/3/issue/{issueIdOrKey}), which uses a similar path to the Jira Cloud REST API. - That means we can practise with an API we may already know before we build a plugin for our own production systems.
What does Purple Expense provide for our plugin?
- Purple Expense is the travel and expense app in PurpleSuite. It’s the system our plugin connects to in this series.
- Purple Expense has booking records, and API operations to find and cancel them. They’re sample records, so we can test our plugin and then open a booking to see whether it changed, without affecting anyone’s real travel plans.
- The Trips page lists each trip and its bookings. Each booking shows details a traveller would recognise, like the vendor, dates and confirmation number.
- Each booking also has a separate booking ID. Travellers know a booking by its confirmation number, but the API needs the booking ID to cancel it.
Where do we find the API reference and credentials?
- The Purple Expense API reference lists the operations behind those records, including List travel bookings and Cancel a booking. We’ll give ToolSmith this reference when we build.
The Purple Expense API docs open at Cancel a booking: the POST /bookings/{id}/cancel operation, its parameters and an example request, with the API token masked
- To call those operations, a plugin needs the instance’s credentials. The instance ID tells PurpleSuite which instance to use, and the API token authenticates each request.
- You’ll find both under Credentials in the instance’s ⋮ menu.
The Credentials page in the instance settings, showing the instance ID, the masked API token and the MCP server URL
- We can browse the records ourselves, but our plugin reaches them through the APIs, using those credentials.
- PurpleSuite also offers its apps as MCP tools that an AI assistant can use. Our plugin needs to follow its own steps, so it calls the APIs with HTTP actions.
BROWSER HTTPS API MCP
Explore records Instance ID and Tools for an
API token AI assistant
(our plugin)
│ │ │
v v v
┌────────────────────────────────────────────────────┐
│ PURPLESUITE INSTANCE │
│ Our own test environment, with sample data │
│ │
│ ┌────────────────────────────────────────────────┐ │
│ │ PURPLE EXPENSE │ │
│ │ Travel bookings to look up and cancel │ │
│ └────────────────────────────────────────────────┘ │
│ Also IT support, HR, project tracking and more │
└────────────────────────────────────────────────────┘
- We won’t create the connector in this section. ToolSmith creates it during the build, which we’ll do later in the series. When we do, the instance ID goes in a request header, which is extra information sent with each request.
- Next, in Build a plugin with ToolSmith, we’ll describe our task to ToolSmith, watch it research the API, and review and approve its plan before it starts building.
Build a plugin with ToolSmith
- We’ll use ToolSmith to build a plugin that finds travel bookings in Purple Expense and lets us request cancellation.
- ToolSmith is an assistant inside Tool Studio that can plan, build and edit plugins for us. It proposes a plan first, and builds only once we approve it.
- We’ll work through it in three parts, each with its own video:
- Describe the task and review the plan: how the plugin will connect, what we ask ToolSmith for, and what to check before approving.
- Connect PurpleSuite and review the generated assets: giving ToolSmith our credentials safely, then checking what it built.
- Test the employee’s request and check the result: trying the request in EmployeeWorks and checking the booking in Purple Expense.
Describe the task and review the plan
What will our plugin need to do?
- In our example, we’re a travel operator, and a client has asked us to cancel one of their bookings.
- The plugin needs to find the client’s bookings, let us choose one, ask for confirmation, and report whether cancellation succeeded. The selected booking ID connects the lookup to the cancellation request.
┌────────────────────────────────────────────────────┐
│ FIND BOOKINGS │
│ The client’s confirmed bookings, │
│ each with its booking ID │
└────────────────────────────────────────────────────┘
│ we recognise the one the client means
v
┌────────────────────────────────────────────────────┐
│ CHOOSE A BOOKING │
│ We pick one; its booking ID is kept │
└────────────────────────────────────────────────────┘
│ before anything changes
v
┌────────────────────────────────────────────────────┐
│ CONFIRM │
│ The AI Assistant asks; we agree │
└────────────────────────────────────────────────────┘
│ the selected booking ID
v
┌────────────────────────────────────────────────────┐
│ REQUEST CANCELLATION │
│ Sends the cancellation for that booking ID │
└────────────────────────────────────────────────────┘
│ the API’s response
v
┌────────────────────────────────────────────────────┐
│ REPORT THE RESULT │
│ The AI Assistant says whether it worked │
└────────────────────────────────────────────────────┘
- ToolSmith will create the connector and actions after we approve its plan. Before we write our prompt, let’s plan the rest of what it should cover: how the plugin connects, whose bookings it finds, and who can use it.
- Let’s look at how the Purple Expense API handles access and identifies the client whose bookings we want.
- Authentication establishes the identity making a request. Our connector will use the instance’s API token, a credential that authenticates requests to PurpleSuite. Here, we’re taking a service-account approach: the integration uses its own credentials rather than asking each person to sign in.
- The connector also sends the instance ID in the
X-Instance-IDheader, information included alongside an API request, so PurpleSuite knows which instance to use. The connector’s settings apply to every request; each HTTP action can add headers of its own. - PurpleSuite then lets us impersonate one of its users, meaning act as that user without signing in as them. Each action sends the client’s email in the
X-PS-Impersonate-Userheader. - The client’s email tells the plugin whose bookings to find. So we’ll design the plugin to use the email we give it, or ask for it, and never fall back to our own login email. The actions will use it in the header and booking filter. That lets us handle different clients with the same assets.
> When connecting to other systems: Authentication and permissions vary between third-party systems. What we can read or change depends on the credentials we use and the access that system grants them. User authentication may let us work with the employee’s own access; a service account uses its assigned permissions and may need an employee identifier supplied separately. Check the system’s API documentation to understand which approach fits the task. Moveworks’ access-control guidance and HTTP connector guide explain the connection options.
- EmployeeWorks already has information about the person using the plugin, such as their email address. These details are called user attributes. A self-service plugin can pass them in, so employees don’t have to enter their own details again.
- Our plugin is different: we’re the ones using it, but the bookings belong to the client. So it asks for the client’s email rather than using ours.
- The plugin’s launch configuration determines who can use it. Our prompt asks ToolSmith to limit it to us while we test. That’s separate from the client’s email: the launch configuration controls who can use the plugin in EmployeeWorks, and the client’s email controls whose bookings it finds in PurpleSuite.
┌────────────────────────────────────────────────────┐
│ US, THE TRAVEL OPERATOR, IN EMPLOYEEWORKS │
│ Launch configuration: only we can use it │
└────────────────────────────────────────────────────┘
│ ask to cancel a client’s booking
v
┌────────────────────────────────────────────────────┐
│ AI ASSISTANT, RUNNING OUR PLUGIN │
│ Uses the client’s email, asking if it’s missing │
└────────────────────────────────────────────────────┘
│ each HTTP action sends an API request
v
┌────────────────────────────────────────────────────┐
│ API REQUEST │
│ FROM THE HTTP CONNECTOR (EVERY REQUEST) │
│ API token: authenticates us │
│ X-Instance-ID header: which instance │
│ ADDED BY THE HTTP ACTION (THIS REQUEST) │
│ X-PS-Impersonate-User header: the client’s │
│ email, so we act as them │
└────────────────────────────────────────────────────┘
│ to our instance
v
┌────────────────────────────────────────────────────┐
│ PURPLE EXPENSE (PURPLESUITE) │
│ Finds or cancels that client’s bookings │
└────────────────────────────────────────────────────┘
RESULTS go back to the AI Assistant, which reports them.
Give ToolSmith the request
- Open ToolSmith in Tool Studio and describe the task. Our prompt says which system to use, the steps to follow, and what to do if there’s no clear match.
- It also asks for a new connector, access for just us while we test, and build tests that only look up bookings.
- We’ve also linked the Purple Expense API docs, so ToolSmith can look up what it needs.
- Here’s our example prompt, with one bullet for each ask:
- Build a plugin for a travel operator handling a client's request to cancel a travel booking in Purple Expense. Use the client's employee email, asking for it if needed rather than using my login email.
- Show their confirmed bookings, let me choose one, and ask for confirmation before cancelling only that booking. If there are no matches, the choice is unclear or I decline, cancel nothing.
- Create a new connector for my Purple Suite instance rather than reusing existing connectors or actions; I'll provide credentials when asked.
- Limit access to me while testing. During the build, run lookup checks only; do not cancel bookings.
- API docs: https://marketplace.moveworks.com/api/purple-suite/docs/expense/purplesuite
ToolSmith’s prompt box with our bulleted request: build a plugin for a travel operator, show the client’s confirmed bookings and confirm before cancelling, create a new Purple Suite connector, limit access to me with lookup-only checks, and a link to the Purple Expense API docs
- We’ll look at what makes a prompt like this useful in How do you write a useful ToolSmith prompt? For more tips, see Write effective prompts.
From our request to a proposed plan
- ToolSmith starts by researching the API operations, and works out how to connect them into the requested process.
- It searches the Action Catalog, a library of API documentation, for relevant operations when a system is covered. The catalog provides request parameters and response definitions; our prompt also links directly to the Purple Expense reference.
- To browse the catalog, open the Moveworks AI Agent Marketplace, select Explore and, under the ToolSmith filter, choose ToolSmith optimized.
The AI Agent Marketplace Explore page filtered to ToolSmith optimized, listing systems such as Datadog, Box, Confluence Cloud, Freshservice, Google Drive and Zendesk
- Open a system, such as Greenhouse or Microsoft Graph, and its Action Catalog tab lists the actions ToolSmith can build for it, from its published API documentation. Greenhouse, a recruiting system, lists over 100, like adding a candidate or listing applications.
Greenhouse’s Action Catalog tab, listing 131 actions ToolSmith can build from its published API documentation, filterable by GET, POST, PUT, PATCH and DELETE
- Catalog coverage means documentation is available, but your own systems might be set up differently, so you still need to test the generated requests against your instance.
- ToolSmith keeps working through the details until it’s ready to present its plan. This is our chance to check it before anything gets built. Check that it:
- Uses the client’s email, asks for it if it’s missing, and never uses our login email.
- Cancels only the booking we picked, and only after we confirm.
- Cancels nothing if there’s no match, the choice is unclear, or we decline.
- Limits launch configuration to us, and creates a new connector and actions rather than reusing existing ones.
ToolSmith’s Plan ready card with Modify plan and Approve plan, beside the Plan panel showing Phases 3 and 4, where Step 10 is tagged External action
- It’s also important to review the tests that ToolSmith proposes. Steps tagged External action call the API directly and can change data, such as the sample bookings.
- Approving the plan also approves those external actions, so check each one, and ask ToolSmith to change anything you’re not comfortable with. See Review and approve plans.
- In our plan, Step 10 is the only external action, and it only looks up bookings. That looks good, so we approve the plan. We’ll provide credentials when ToolSmith requests them.
- Next, in Connect PurpleSuite and review the generated assets, we’ll give ToolSmith access to our instance and check what it built.
Connect PurpleSuite and review the generated assets
- Now that we’ve approved the plan, ToolSmith can start building. In this part, we’ll connect it to our PurpleSuite instance, see what happens when a build test fails, and check what it built against the plan.
Connect PurpleSuite securely
- ToolSmith’s first step is to create the connector, so it pauses and shows a Credentials needed card. Select Configure… to open the secure Complete Configuration form.
ToolSmith’s Credentials needed card for purple_suite_travel_cancellation_v1, with Configure… and Skip, beside the plan, where Step 1 creates the connector and collects its token and instance ID through the secure form
- ToolSmith has already filled in most of the form from its research into the Purple Expense API, such as the base URL and how the token is sent. We just enter our API token and instance ID, then select Save & Resume.
- Use your own instance’s values, from Credentials in your PurpleSuite instance’s ⋮ menu. API tokens expire after 7 days; if requests start failing later, update the token in the connector.
- Enter tokens and other credentials only in this secure form. Don’t paste them into the ToolSmith conversation. See Configure credentials securely.
When a build test fails
- ToolSmith now builds the assets, and runs the tests from the plan. In our plan, Step 10 was the only external action: a live, read-only lookup that checks confirmed bookings come back.
- In our build, that test failed. The API call worked, but the email ToolSmith tested with had no confirmed bookings, so the lookup returned an empty list.
- That’s to be expected, and a failed test is a normal part of working through an integration. ToolSmith worked out the cause and asked for an email that does have confirmed bookings, for a read-only check only.
ToolSmith explains the lookup returned no bookings and asks which client employee email has at least one confirmed Purple Expense booking, promising a read-only check; in the plan, Step 10 (External action) is marked as failed
- We gave it our client Reyansh’s email. ToolSmith updated the plan, we checked it still only looks up bookings and approved it, and this time the test passed.
- When ToolSmith proposes a fix like this, review what it found and what it wants to change before you approve it.
Check what ToolSmith built
- When the build finishes, ToolSmith lists what it created under Assets: a connector, two HTTP actions, a booking type (a data type and an agent type extension), a conversational process and the plugin.
ToolSmith’s Assets panel listing the new cancel HTTP action, the u_PurpleCancelBooking data type and agent type extension, the purple_expense_cancel_booking conversational process and the plugin, each tagged New
- Open each asset and compare it with the approved plan. Start with the connector and the two HTTP actions:
| What to check | Connector | Booking lookup | Cancel action |
|---|---|---|---|
| Request | Holds the PurpleSuite base URL for every request. | GET /api/purple-suite/expense/bookings, for the client’s confirmed bookings. |
POST /api/purple-suite/expense/bookings/{{{booking_id}}}/cancel |
| Credentials | Sends the API token, and the instance ID in the X-Instance-ID header. |
Inherits them from the connector. | Inherits them from the connector. |
| Client’s email | — | Sent in the X-PS-Impersonate-User header, from the email we give the plugin. |
Sent in the same header. |
| Booking ID | — | Returned with each booking, alongside details we can recognise. | Part of the address, so it cancels the booking we pass in, not an example saved during the build. |
- The booking lookup finds the confirmed bookings for the email we give it, and ToolSmith’s test showed it working for Reyansh.
The booking lookup HTTP action: GET /api/purple-suite/expense/bookings, with an X-PS-Impersonate-User header set to {{{employee_email}}}
- In the cancel action, the booking ID is a variable in the address, so nothing’s hardcoded from the build.
The cancel HTTP action: POST /api/purple-suite/expense/bookings/{{{booking_id}}}/cancel, with the same X-PS-Impersonate-User header
- Next, the conversational process. Before it can cancel, it needs two things: the client’s email and a booking. ToolSmith added a resolver, which looks up the client’s bookings and makes us pick exactly one.
- The cancel step sends that booking’s ID, and its confirmation policy means it won’t run until we confirm. We’ll look at how this is set up in Adding guardrails and business rules to your plugin.
The Cancel Purple Travel Booking process: the cancel activity requires the employee_email and booking slots, maps booking_id from data.booking.id, and has Confirmation Policy ticked to require consent before it runs
- Finally, open the plugin. Ours has six example requests that should start it and five that shouldn’t. Check they describe the task.
- Its launch configuration should allow only you while you test, as our prompt asked.
The plugin’s Launch Configuration tab, with Allow selected users set to our own email
- The build matches the plan. Next, in Test the employee’s request and check the result, we’ll try it in the EmployeeWorks Web App and check the booking in Purple Expense.
Test the employee’s request and check the result
- We’ve checked what ToolSmith built. Now let’s try it the way a travel operator would.
- A response that sounds right isn’t proof that it all worked. So we’ll make a real request, then check the booking in Purple Expense and the plugin’s logs.
┌────────────────────────────────────────────────────┐
│ THE REPLY IN EMPLOYEEWORKS │
│ “The booking is cancelled”: a claim, not proof │
└────────────────────────────────────────────────────┘
│ check the system itself
v
┌────────────────────────────────────────────────────┐
│ PURPLE EXPENSE │
│ The car is Cancelled; the hotel is still Confirmed │
└────────────────────────────────────────────────────┘
│ check what the plugin sent
v
┌────────────────────────────────────────────────────┐
│ LOGS IN TOOL STUDIO │
│ A POST to cancel that booking, a 200 response, │
│ and the booking’s status is now cancelled │
└────────────────────────────────────────────────────┘
Make the request in EmployeeWorks
- ToolSmith published the plugin as part of the build, so it’s already available in EmployeeWorks, and its launch configuration still allows only us.
- Our client, Reyansh, has asked us to cancel one of his bookings. In the EmployeeWorks Web App, we ask:
I need to cancel a travel booking for {{email}}. Please show me their bookings so I can find the right one.
- The plugin uses his email to find two confirmed bookings, a hotel and a car, each with its confirmation number.
EmployeeWorks lists two confirmed bookings for Reyansh, a Hyatt Regency hotel in Seattle and an Ola car, with confirmation numbers, and asks which one to cancel
- We choose the car. The plugin asks us to confirm before anything changes, we select Yes, and it says the booking is cancelled.
Check the booking in Purple Expense
- Don’t just take the reply’s word for it. In Purple Expense, open the client’s trip.
- The car now shows as Cancelled, and the hotel is still Confirmed. The flight was already cancelled, which is why it wasn’t offered as an option.
The SEA Onsite trip in Purple Expense for Reyansh: the Hyatt Regency hotel is Confirmed, and the Qantas flight and Ola car are Cancelled
Check the logs
- Every plugin run is recorded in the Logs app in Tool Studio, including each request a plugin sends and the response it gets back.
- Find the cancel action’s entry for this run. The plugin sent a
POSTusing the selected booking’s ID, and Purple Expense replied with a200, which means the request succeeded. - The response shows the booking’s status is now
cancelled, by a travel operator at the client’s request. So the reply in EmployeeWorks reflects what really happened.
A Logs entry for purple_expense_cancel_booking_v1: a POST to /bookings/BKG-0003/cancel with response code 200, and a response payload for the Ola car showing status cancelled and the reason “Cancelled by a travel operator at the client request”
- If something doesn’t work as expected, the logs are a great place to start. ToolSmith can read them too: select Debug in ToolSmith, or see Debug a plugin.
Try an edge case: saying no
- Testing edge cases shows how a plugin behaves when information is missing, someone changes their mind, or a system can’t complete the request. For our plugin, that could include:
- No matching bookings: say so, without attempting a cancellation.
- An unclear choice: ask which booking we mean before going ahead.
- An API failure: explain the failure, without reporting a successful cancellation.
- Saying no at confirmation: leave the booking unchanged and send no cancellation request.
- Let’s try saying no. We make the same request again. Reyansh only has the hotel left, so the plugin asks us to confirm straight away.
EmployeeWorks finds one confirmed booking for Reyansh, the Hyatt Regency hotel stay, and asks us to confirm its cancellation with Yes or Cancel
- Say Reyansh has changed his mind and wants to keep it. We select Cancel, which means “stop, don’t go ahead”.
- The assistant says the request has been cancelled. That’s the request we made in chat, not the booking. In Purple Expense, the hotel is still confirmed, and the logs show only the lookup, with no cancel action.
Keep improving the plugin
- Use ToolSmith to keep adapting the plugin to your scenario. For example, we could ask it to add a rule that only lets us cancel bookings that haven’t started yet. See Modify a plugin.
- As before, review the plan before you approve it, then test again in EmployeeWorks and check the records in Purple Expense.
- Next, in Adding guardrails and business rules to your plugin, we’ll look at how the process collects the client’s email, keeps track of the chosen booking and waits for confirmation, and add guardrails to protect our business processes.
Adding guardrails and business rules to your plugin
- Our plugin works, but testing it as a travel operator turned up a problem. So now we’ll use ToolSmith to make it more reliable with guardrails and business rules.
- Guardrails are the checks we configure on the plugin’s conversational process, so the assistant asks for the right things, waits before it acts and records what happened. Business rules are our own organisation’s conditions, such as who gets a refund.
- For each change, we’ll ask ToolSmith, see what it created in Tool Studio, and test it in EmployeeWorks. We’ll add four things:
WHAT WE’LL ADD TO THE PLUGIN
┌────────────────────────────────────────────────────────────┐
│ 1. SLOT INFERENCE POLICY │
│ Asks for the right value, so it never acts on a guess │
└────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────┐
│ 2. CONFIRMATION POLICY │
│ Checks before it acts: nothing changes without a yes │
└────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────┐
│ 3. RESOLVERS │
│ Pick from valid options, so every record stays consistent │
└────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────┐
│ 4. DECISION POLICIES │
│ Apply your business rules the same way, every time │
└────────────────────────────────────────────────────────────┘
What is a slot inference policy?
- Here’s the first problem. We asked to cancel a booking without saying which client, and the plugin checked bookings against our own email instead.
EmployeeWorks replies “I checked bookings for christian…” with our own email, instead of asking which client the booking belongs to
- So we describe the problem to ToolSmith. In Tool Studio, we open the plugin’s ⋮ menu, select Modify with ToolSmith and send:
We’ve been testing the Purple Expense cancellation plugin and found that, when no client e-mail address is provided, it sometimes assumes the signed-in operator’s e-mail address. Investigate recent executions and make client identity handling explicit and reliable. PurpleSuite traveller records do not match our employee directory, so the solution must remain independent of directory matching.
- ToolSmith checks the recent runs and traces the problem to how the plugin collects the client’s email.
- The plugin stores that email in a slot: a value the process needs before it can act.
- Each slot has a slot inference policy, which decides whether the assistant can fill it in from what it already knows, or has to ask.
- Originally, this slot was called
employee_email. But is that our email, or the client’s? Vague names like that make it harder for the assistant to infer the right value, and here, it guessed ours. - So ToolSmith renamed the slot
client_traveler_email, for clarity, and set its inference policy to Always prompt the user.
The client_traveler_email slot in the Cancel Purple Travel Booking process, with Slot Inference Policy set to Always prompt the user
┌────────────────────────────────────────────────────────────┐
│ SLOT: CLIENT_TRAVELER_EMAIL │
│ A value the process needs before it can act │
└────────────────────────────────────────────────────────────┘
│
v
┌────────────────────────────────────────────────────────────┐
│ SLOT INFERENCE POLICY │
│ Always prompt the user │
└────────────────────────────────────────────────────────────┘
│
v
┌────────────────────────────────────────────────────────────┐
│ RESULT │
│ The assistant asks for the traveller’s email │
└────────────────────────────────────────────────────────────┘
- A clear slot name and description help the assistant, but the policy is what makes it ask. As the docs put it: “Descriptions inform. Policies enforce.”
- Let’s try that again. This time, the assistant asks for the traveller’s email. We give it Reyansh’s, it finds his booking, and it asks us to confirm.
EmployeeWorks asks for the exact PurpleSuite traveller email address before it shows any bookings
What is a confirmation policy?
- That confirmation is another guardrail: a confirmation policy on the cancel activity, set to Require consent from the user. ToolSmith added it when we asked for confirmation in our first prompt, back in Describe the task and review the plan.
- A confirmation policy shows the values the assistant has collected and asks for our consent before the activity runs.
┌──────────────────────────────────────────────────────────┐
│ CONFIRMATION POLICY, BEFORE THE ACTION RUNS │
│ The assistant asks us to confirm │
└───┬──────────────────────────────────────────────────────┘
├──> CANCEL: nothing changes
└──> YES: the booking is cancelled
- Nothing changes until we say yes.
What are resolvers?
- Next, we want a record of who cancelled each booking, and why. We ask ToolSmith:
Improve the cancellation audit trail by recording the signed-in travel operator and collecting a structured cancellation reason. Include options such as traveller request, duplicate or incorrect booking, travel plans changed, and supplier disruption. Clearly distinguish the traveller, operator, and reason in the confirmation and result.
- ToolSmith added a slot for the cancellation reason, with a resolver. A resolver controls where a slot’s options come from. There are two kinds.
- A dynamic resolver calls an action, so the options stay up to date. Our booking slot already uses one to look up the client’s bookings, and the slot then holds the whole booking the user picks.
┌────────────────────────────────────────────────────────────┐
│ DYNAMIC RESOLVER (BOOKING SLOT) │
│ Calls an action, usually an HTTP request │
└────────────────────────────────────────────────────────────┘
│ sends the client’s email
v
┌────────────────────────────────────────────────────────────┐
│ PURPLESUITE API │
│ Looks up the client’s confirmed bookings │
└────────────────────────────────────────────────────────────┘
│ one option per booking it finds
v
┌────────────────────────────────────────────────────────────┐
│ OPTIONS TO CHOOSE FROM │
│ The assistant offers them; we pick one │
└────────────────────────────────────────────────────────────┘
│
v
┌────────────────────────────────────────────────────────────┐
│ BOOKING SLOT │
│ Holds the whole chosen record (ID, start time, cost) │
└────────────────────────────────────────────────────────────┘
- A static resolver is a fixed list. Each option has a Display Value that people see and a Raw Value that the plugin uses, like Low priority and
low. Our cancellation reasons are a static list of four.
The cancellation reason’s Strategy Definition: a Static method listing four options, each with a Display Value and a Raw Value: Traveller request, Duplicate or incorrect booking, Travel plans changed and Supplier disruption
- In EmployeeWorks, the assistant now offers those four reasons for us to choose from, so every record uses the same values.
EmployeeWorks finds Reyansh’s hotel booking in Seattle and asks us to choose a cancellation reason from four numbered options
- ToolSmith also added a slot for the signed-in operator, which the cancel request sends as
cancelled_by. We’ll see it in the logs shortly.
How do decision policies apply business rules?
- So far, our guardrails make sure the plugin asks for the right things and records them. But you probably have your own business rules, like who gets a refund. Let’s add one:
Add deterministic business rules to calculate the refund before cancelling a booking. Supplier disruptions should receive a full refund regardless of timing. Traveller-requested cancellations within 24 hours of travel should receive no automatic refund, and traveller-requested cancellations outside that window should receive a full refund. For any other reason, don't calculate a refund; tell the operator it needs manual review. Show the calculated refund in the confirmation and record it when cancelling the booking.
- ToolSmith added a script action that works out the refund. A script action runs custom code, written in APIthon (a variation of Python), for calculations like this one.
- Then it added a decision policy that picks a path from the result. A decision policy runs a set of steps when its condition is true, so the rule is applied the same way every time.
- In our plugin, a manual review shows a message and stops, and an automatic refund carries on to the cancellation.
┌──────────────────────────────────────────────────────────┐
│ SCRIPT ACTION │
│ Works out the refund from start time, cost and reason │
└──────────────────────────────────────────────────────────┘
│
v
┌──────────────────────────────────────────────────────────┐
│ DECISION POLICY │
│ Picks a path from the result │
└───┬──────────────────────────────────────────────────────┘
├──> NEEDS MANUAL REVIEW: show a message, then exit.
│ No cancellation.
├──> AUTOMATIC REFUND: continue to the cancellation
└──> DEFAULT: show a message. No cancellation.
The process canvas: the refund script action, then a Policy with two cases. The selected case’s condition is data.refund_decision.requires_manual_review, which leads to a message and Exit; the second case leads to the cancel action
- Let’s test it. The first booking starts within 24 hours, and the traveller has asked us to cancel. The plugin tells us the automatic refund is USD 0.00, so we don’t go ahead with that one.
EmployeeWorks says the booking is within about 6 hours of travel, so the automatic refund is USD 0.00, and asks us to confirm the cancellation with Yes or Cancel
- Next, we try a booking for another client, Kabir, that’s three days out. This time, it qualifies for a full refund of USD 421, so we confirm, and the booking is cancelled.
- In the Logs, the cancel request included the refund, the reason, and our email as the operator.
A Logs entry for the cancel action: a POST with response code 200, and a request payload with cancelled_by set to our email, cancellation_reason “Traveller request” and refund_amount 421
Can we go back to an earlier version?
- Each time ToolSmith published a change, Tool Studio saved it as a new version. That covers most assets, like plugins, processes and actions, so you can review an earlier version or restore it. Open it from the asset’s Version history; see Plugin versioning.
- Every guardrail here came from a sentence in our prompts. Next, in How do you write a useful ToolSmith prompt?, we’ll look at what makes those sentences work.
Frequently asked questions
We’ll add to these answers as the series continues.
Do I still need Tool Studio if I use ToolSmith?
Yes. ToolSmith proposes and builds from a reviewed plan; the developer still inspects the plugin’s connection, actions, inputs, process, and access in Tool Studio and tests the employee-facing result. See the ToolSmith overview.
Can I use an MCP server instead of building a plugin?
Sometimes. A trusted MCP server can be a good fit for a bounded live lookup or action. Use a plugin when you need to define an employee-facing sequence with record resolution, policy checks, and confirmation. Before using an MCP server, you should inspect the server’s own access and action controls. See the MCP Workspace overview and current limitations.
Where to go next
Next up: How do you write a useful ToolSmith prompt?
We’ll look at what makes a ToolSmith prompt useful, and what to tell ToolSmith about your own task so it plans the plugin you need.
Planning to build along? ToolSmith is currently an early-access capability, so request access through the ToolSmith page now, ahead of the hands-on chapters. In the meantime, the ToolSmith overview explains what it can do.
Have a ToolSmith or EmployeeWorks plugin question this guide doesn’t answer? Share the task you were trying to complete and where you got stuck in the comments, so a future lesson can address that specific problem.
- 2,470 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.