Skip to content

Tool

draft_email_interpret_skill

Create a skill from this email

SurfacesChat agent

Draft a reusable Skill that interprets emails like the referenced one — extract structured data and render a result block. Ask the user what they want to happen for emails like this BEFORE calling. Pass the captured intent as `spec` (a structured LLM skill: instructions + an outputSchema describing the fields to extract + a verdict map turning them into extracted data and a UI component). Pass the referenced email as `sample` so the draft can be previewed. To EDIT an existing draft, pass its `draftId` and the updated `spec`. This never goes live on real mail — it creates a draft a teammate can preview, refine, and (as an admin) activate.

Parameters

NameTypeRequiredDescription
draftIdstringnoSet to edit an existing draft (creates a new version); omit to create a new one.
specobjectyes—
▸expand spec
  • id stringrequired

    A slug for the skill, e.g. "flight-watch" (lowercase, dashes/underscores).

  • label stringrequired

    A short human label, e.g. "Flight watcher".

  • kind "llm"required

    Always "llm" for now (the model interprets the email).

  • appliesTo messagethreadrequired

    Run per message or per thread.

  • description string
  • tagline string
  • instructions stringrequired

    What the model should look for / extract from emails like this.

  • outputSchema objectrequired

    A JSON-Schema OBJECT describing the fields the model should return.

  • ▸tools object[]

    Optional read-only enrichment tools by name. Allowed: http_get, flight_status.

    array items — object

    • name stringrequired
    • config object
  • ▸verdict objectrequired

    How to turn the model output into a verdict (extracted data + UI).

    • gateField string

      Output field that must be truthy (or equal gateEquals) for the skill to fire.

    • ▸gateEquals one of
      • option 1string
      • option 2number
      • option 3boolean
    • extra object

      extra fields to write. A value of {"$":"field"} reads that field from the model output.

    • flags string[]
    • category string
    • component string

      A verdict component id to render. Built-ins: otp-quick-copy, reset-link-button, track-package, receipt-card, calendar-invite, flight-card, unsubscribe-button. Unknown ids render a generic card.

    • draftInstructions string

      If set, propose a reply draft with these instructions (never sent).

  • ▸search object
    • extraKeys string[]
    • flags string[]
    • categories string[]
changeSummarystringnoOne line describing this version's change (for the history).
sampleobjectnoThe example email this skill is built from (usually the referenced message). Used to preview the draft.
▸expand sample
  • label string
  • from stringrequired
  • to string[]
  • subject stringrequired
  • body stringrequired
  • headers object

Example

json
{
  "spec": {
    "id": "<id>",
    "label": "<label>",
    "kind": "llm",
    "appliesTo": "message",
    "instructions": "<instructions>",
    "outputSchema": "<outputSchema>",
    "verdict": {}
  }
}