Skip to article

A field note from a facilities desk that holds government work.

How to set up email triage for a facilities company

Set it up as a skill the agent runs on a schedule. It reads a short knowledge base of the live facilities, connects to Gmail, labels each thread, and archives until the inbox holds 20 threads or fewer.

It organizes mail. It never drafts, replies, or sends. I built this on a facilities maintenance and management desk. The shots below are that build, in the order the work happened.

What you are building

An email triage agent is a repeatable job, not a chat you open once. You describe the current work in a markdown file, connect Gmail, and hand the agent one skill: keep the inbox at or under 20 threads, label what you file, and report what changed.

On this desk, important is specific. A live work order, an open government facility, a certificate of insurance about to lapse, and a message from the person who owns the contract stay in view. A confirmation, a CC, a receipt, and a vendor blast get a label and leave the inbox. The mail stays in All Mail. Nothing is deleted.

  • Harness. The app you work in. This build uses Grok Bot.
  • Tools. Search, read, label, and archive. Not send.
  • MCP. The connection from the app to Gmail.
  • Knowledge base. Which buildings, contracts, and people are live.
  • Skill. The name, the description, and the steps for this one job.
  • Cloud run. The same skill, on a schedule, without you in the chat.

What the inbox actually held

A facilities desk that serves government buildings does not clog on newsletters. It clogs on operational mail nobody filed: work orders, vendor threads, insurance and credentials, portal notices, bid mail that has not been screened, and a thin slice of mail from a contracting officer or a site contact that needs a decision.

A filter that only catches promotions leaves that pile alone. The agent has to know which building is live this month. That is the knowledge base.

Set it up

1. Name the job

Download Grok Bot from x.ai/bot and create a bot for this one job. Name it for the work. Email Cleaner is enough.

Create New Bot dialog in Grok Bot. The bot is named Test Email Cleaner and a blue icon is selected.
Figure 1. Create the bot and name it for the job before you connect any mail.

Once it exists, the bot asks what you want done, as if it already has a guess. Answer from the operation: this is a facilities company, the mailbox is the one dispatch and project managers actually read, and the outcome is an inbox of 20 threads or fewer.

Test Email Cleaner asking what to focus on first, with choices for promos, replies, unsubscribes, a regular cleanup, or something else.
Figure 2. The bot asks where to start. For this desk the answer is the live work, not a promo sweep.

2. Connect Gmail

Open Connect Apps and connect the Gmail server. MCP is the open connection between the app and an outside system. The host is the app you are using. The server is Gmail. The model decides which tool to call, and the host brings the result back.

The host asks the server what it can do. For Gmail that list is search, read, draft, and manage. Connecting the server does not give the agent permission to speak for the company. The skill refuses that.

Gmail connected to the agent, described as search, read, draft, and manage email.
Figure 3. Gmail is connected. The skill below is what keeps draft and send from being used.

3. Feed the knowledge base, then the prompt

Give the agent a markdown file of the company right now: active government facilities and the contracts on them, who speaks for each, the vendors the company actually uses, and which domains belong to the company, the customer, the insurers, and the portals. A stale file files mail against work you finished.

Then give it the job in one prompt. Read the knowledge base. Build a skill that understands the inbox, the labels, and the projects. Keep the inbox to 20 items. Label what moves. Return a summary. Never write, draft, or send.

The triage prompt attached to the facilities knowledge base file, instructing the agent to read it and keep the inbox to a maximum of 20 items.
Figure 4. The facilities knowledge base is attached with the prompt that caps the inbox at 20.

4. Save it as a skill

Ask the agent to save the job as a skill, then run it on a schedule. A skill is a folder of instructions for one kind of task. This one is named Inbox Organizer (Max 20). It loads the knowledge base, reuses labels you already have, classifies each thread, labels it before it moves, and archives until 20 or fewer remain.

Keep a thread when a person owes a reply or a decision, or when it is a live facility thread from the last few days. File confirmations and CCs. File receipts, billing, insurance, credentials, and portal notices. File newsletters. Archive only. Leave starred mail, and anything from the last day that names a deadline. If the agent is unsure, the thread stays and the report says so.

5. Read the report

The run writes a summary a facilities lead can read in a minute: the count before and after, what stayed and why, and where everything else went. On November 9, 2026 this desk went from 107 conversations to 9. Nothing was deleted.

Inbox Cleanup Report for November 9, 2026. Conversations in the inbox fell from 107 to 9. The report says nothing was deleted.
Figure 5. The report from the facilities run. 107 conversations to 9. Deleted: nothing.

What stays, what gets filed

How the skill treats each kind of facilities mail
MailWhat the agent doesWhy
Contracting officer, property manager, or site contact on a live facilityStays in the inboxA person owes a decision or a reply
Open work order with a deadlineStays if it is unresolvedThe building is the work
Vendor thread that is only a confirmation or a CCLabel by vendor or site, then archiveThe team can find it. It does not need the morning.
Insurance, billing, credential, portal noticeLabel as reference, then archiveIt is a record, unless the notice says something lapsed
Bid mail that has not been screenedLabel it, keep it out of the action pileUnscreened solicitation mail is not a recommendation to bid
Newsletter or automated alertLabel as low value, then archiveIt is not a facility

Three ways to handle the same mail

Shared inbox, filters, and a triage agent compared
Shared inboxFilters onlyTriage skill
Knows which facilities are liveOnly if a person remembersNoYes, from the knowledge base
Reuses labels you already haveOccasionallyRarelyYes, before it creates a new one
Inbox capNoneNone20 threads
Sends or repliesWhoever writes itNoNever
Record of what movedNoNoA summary every run

Filters are the right tool for a sender you never want to see. They are the wrong tool for a work order that is routine on Tuesday and a stop-work on Wednesday.

What the agent will not do

This skill does not write to a contracting officer, a tenant, or a vendor. Archive removes the inbox label and leaves the thread under the label you applied. A crowded inbox is a nuisance. A buried government email is a loss.

The same shape of skill can point at another channel later. This build is Gmail, because that is where this company’s record of the work already lives. The original walkthrough is on PromptimusPrime.

Questions

How do you set up email triage for a facilities maintenance company?

Write a knowledge base of the live facilities, contracts, and contacts. Connect Gmail to the agent. Install one skill that labels every thread and archives until the inbox has 20 items or fewer. Run that skill on a schedule. The skill never drafts or sends.

Will the agent reply to a contracting officer or a site contact?

No. The skill may search, read, label, and archive. Drafting, replying, forwarding, and sending stay with a person.

What is MCP in an email triage setup?

MCP connects the agent app to Gmail. The app asks the Gmail server which tools exist, then calls them. The skill decides what those calls are allowed to change.

What should a facilities company put in the knowledge base?

The buildings and contracts that are active, the people who speak for each, the vendors the company actually uses, and the domains for the company, the customer, insurers, and portals. Update it when a facility opens or closes.

What earns a spot in the inbox?

A thread stays when a person owes a reply or a decision, when a deadline is inside the last day, or when the sender is a key contact on a live facility. Everything else is labeled and archived. Starred mail stays.

How is this different from Gmail filters?

Filters match a sender or a word and move mail whether the building is live or not. The triage skill reads the knowledge base first, reuses your labels, and writes a report of what it kept.

Can this run every morning without someone in the chat?

Yes. Save the job as a skill and schedule it. The morning output is the summary: the count before and after, what stayed, what was filed, and what the agent was unsure about.

Does the agent delete mail?

No. It archives. Archived mail stays searchable in All Mail under its label. The facilities run on November 9, 2026 deleted nothing.

Have us set the first one up

The first workflow is the inbox. After it runs for a week, the next one is whichever leak the report keeps surfacing.

Book a call

How an OnCode engagement starts