Field Service logo

Field Service

Organization
serac-labs
field-service

Build ServiceNow Field Service Management — wm_order work orders, wm_task tasks, wm_resource technicians with skills/territories, dispatch/auto-assignment, mobile status updates, and time entries.

Overview

Publisherserac-labs
Repositoryserac
Skill namefield-service
Stars
78
Forks
26
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by serac-labs on GitHub. Read the source before you install it.

Installation

Install the Field Service AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/serac-labs/serac.git /tmp/serac
mkdir -p .claude/skills
cp -r /tmp/serac/packages/skills/field-service .claude/skills/field-service
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Field Service in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Field Service on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Field Service is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Field Service Management for ServiceNow

Field Service Management (FSM) manages work orders, technician dispatch, and mobile field operations.

FSM Architecture

Work Order (wm_order)
    ├── Work Order Tasks (wm_task)
    │   ├── Time Entries
    │   └── Parts Used
    ├── Asset/CI
    └── Location

Dispatch
    ├── Scheduling
    └── Route Optimization

Key Tables

TablePurpose
wm_orderWork orders
wm_taskWork order tasks
wm_resourceField technicians
wm_schedule_entrySchedule entries
wm_territoryService territories

Work Orders (ES5)

Create Work Order

javascript
// Create work order (ES5 ONLY!)
var workOrder = new GlideRecord("wm_order")
workOrder.initialize()

// Basic info
workOrder.setValue("short_description", "HVAC repair - Building A")
workOrder.setValue("description", "AC unit not cooling properly")
workOrder.setValue("priority", 2)

// Classification
workOrder.setValue("work_order_type", "repair")
workOrder.setValue("category", "hvac")

// Location
workOrder.setValue("location", locationSysId)
workOrder.setValue("cmdb_ci", hvacUnitCISysId)

// Customer/Contact
workOrder.setValue("account", customerAccountSysId)
workOrder.setValue("contact", contactSysId)

// Scheduling
var scheduledStart = new GlideDateTime()
scheduledStart.addDaysLocalTime(1)
workOrder.setValue("scheduled_start", scheduledStart)

// Assignment
workOrder.setValue("assignment_group", fieldServiceGroupSysId)

// SLA
workOrder.setValue("sla", slaDefinitionSysId)

workOrder.insert()

Work Order Tasks

javascript
// Create work order tasks (ES5 ONLY!)
function createWorkOrderTasks(workOrderSysId, tasks) {
  var createdTasks = []

  for (var i = 0; i < tasks.length; i++) {
    var task = new GlideRecord("wm_task")
    task.initialize()
    task.setValue("work_order", workOrderSysId)
    task.setValue("short_description", tasks[i].description)
    task.setValue("order", (i + 1) * 100)

    // Estimated duration
    task.setValue("estimated_duration", tasks[i].duration)

    // Skills required
    if (tasks[i].skills) {
      task.setValue("skills", tasks[i].skills)
    }

    // Parts needed
    if (tasks[i].parts) {
      task.setValue("u_parts_required", tasks[i].parts)
    }

    var taskSysId = task.insert()
    createdTasks.push({
      sys_id: taskSysId,
      number: task.getValue("number"),
    })
  }

  return createdTasks
}

// Example
createWorkOrderTasks(workOrderSysId, [
  { description: "Diagnose AC unit", duration: "01:00:00", skills: "hvac_certified" },
  { description: "Replace compressor", duration: "02:00:00", parts: "COMP-AC-001" },
  { description: "Test and verify", duration: "00:30:00" },
])

Technician Management (ES5)

Create Resource Profile

javascript
// Create field technician profile (ES5 ONLY!)
var resource = new GlideRecord("wm_resource")
resource.initialize()

// Link to user
resource.setValue("user", userSysId)

// Skills
resource.setValue("skills", "hvac_certified,electrical,plumbing")

// Territory
resource.setValue("territory", territorySysId)

// Availability
resource.setValue("work_schedule", scheduleId)

// Vehicle/Equipment
resource.setValue("vehicle", vehicleCISysId)

// Active
resource.setValue("active", true)

resource.insert()

Check Technician Availability

javascript
// Get available technicians for time slot (ES5 ONLY!)
function getAvailableTechnicians(scheduledStart, scheduledEnd, requiredSkills, territory) {
  var available = []

  // Get all active technicians in territory
  var resource = new GlideRecord("wm_resource")
  resource.addQuery("active", true)
  if (territory) {
    resource.addQuery("territory", territory)
  }
  resource.query()

  while (resource.next()) {
    // Check skills
    if (requiredSkills && !hasRequiredSkills(resource, requiredSkills)) {
      continue
    }

    // Check availability
    if (!isAvailable(resource, scheduledStart, scheduledEnd)) {
      continue
    }

    var user = resource.user.getRefRecord()
    available.push({
      resource_sys_id: resource.getUniqueValue(),
      user_sys_id: user.getUniqueValue(),
      name: user.getDisplayValue(),
      skills: resource.getValue("skills"),
      territory: resource.territory.getDisplayValue(),
    })
  }

  return available
}

function hasRequiredSkills(resource, requiredSkills) {
  var techSkills = resource.getValue("skills").split(",")
  var required = requiredSkills.split(",")

  for (var i = 0; i < required.length; i++) {
    if (techSkills.indexOf(required[i].trim()) === -1) {
      return false
    }
  }
  return true
}

function isAvailable(resource, start, end) {
  // Check for conflicting assignments
  var assignment = new GlideRecord("wm_schedule_entry")
  assignment.addQuery("resource", resource.getUniqueValue())
  assignment.addQuery("start", "<", end)
  assignment.addQuery("end", ">", start)
  assignment.query()

  return !assignment.hasNext()
}

Dispatch & Scheduling (ES5)

Assign Work Order

javascript
// Dispatch work order to technician (ES5 ONLY!)
function dispatchWorkOrder(workOrderSysId, resourceSysId, scheduledStart, scheduledEnd) {
  // Create schedule entry
  var schedule = new GlideRecord("wm_schedule_entry")
  schedule.initialize()
  schedule.setValue("work_order", workOrderSysId)
  schedule.setValue("resource", resourceSysId)
  schedule.setValue("start", scheduledStart)
  schedule.setValue("end", scheduledEnd)
  schedule.setValue("state", "scheduled")
  schedule.insert()

  // Update work order
  var wo = new GlideRecord("wm_order")
  if (wo.get(workOrderSysId)) {
    wo.setValue("assigned_to", getResourceUser(resourceSysId))
    wo.setValue("scheduled_start", scheduledStart)
    wo.setValue("scheduled_end", scheduledEnd)
    wo.setValue("state", "assigned")
    wo.update()
  }

  // Notify technician
  gs.eventQueue("wm.work_order.assigned", wo, resourceSysId, "")

  return schedule.getUniqueValue()
}

Auto-Dispatch

javascript
// Auto-dispatch to best available technician (ES5 ONLY!)
function autoDispatch(workOrderSysId) {
  var wo = new GlideRecord("wm_order")
  if (!wo.get(workOrderSysId)) {
    return { success: false, message: "Work order not found" }
  }

  // Get requirements
  var scheduledStart = new GlideDateTime(wo.getValue("scheduled_start"))
  var estimatedDuration = wo.getValue("estimated_duration") || "02:00:00"

  var scheduledEnd = new GlideDateTime(scheduledStart)
  var durationParts = estimatedDuration.split(":")
  scheduledEnd.addSeconds(
    parseInt(durationParts[0], 10) * 3600 + parseInt(durationParts[1], 10) * 60 + parseInt(durationParts[2], 10),
  )

  var requiredSkills = wo.getValue("u_required_skills")
  var location = wo.location.getRefRecord()
  var territory = location.getValue("u_territory")

  // Find available technicians
  var available = getAvailableTechnicians(scheduledStart, scheduledEnd, requiredSkills, territory)

  if (available.length === 0) {
    return { success: false, message: "No available technicians" }
  }

  // Select best match (first available, could add routing optimization)
  var bestMatch = available[0]

  // Dispatch
  var scheduleId = dispatchWorkOrder(workOrderSysId, bestMatch.resource_sys_id, scheduledStart, scheduledEnd)

  return {
    success: true,
    technician: bestMatch.name,
    schedule_id: scheduleId,
  }
}

Mobile Field Service (ES5)

Update Work Order Status (Mobile)

javascript
// Update from mobile app (ES5 ONLY!)
function updateWorkOrderFromMobile(workOrderSysId, statusUpdate) {
  var wo = new GlideRecord("wm_order")
  if (!wo.get(workOrderSysId)) {
    return { success: false, message: "Work order not found" }
  }

  // Update state
  if (statusUpdate.state) {
    wo.setValue("state", statusUpdate.state)

    if (statusUpdate.state === "work_in_progress") {
      wo.setValue("actual_start", new GlideDateTime())
    } else if (statusUpdate.state === "closed_complete") {
      wo.setValue("actual_end", new GlideDateTime())
    }
  }

  // Add work notes
  if (statusUpdate.notes) {
    wo.work_notes = statusUpdate.notes
  }

  // Update location (GPS)
  if (statusUpdate.latitude && statusUpdate.longitude) {
    wo.setValue("u_technician_latitude", statusUpdate.latitude)
    wo.setValue("u_technician_longitude", statusUpdate.longitude)
  }

  wo.update()

  return { success: true }
}

Record Time Entry

javascript
// Record technician time (ES5 ONLY!)
function recordTimeEntry(workOrderSysId, timeData) {
  var entry = new GlideRecord("time_card")
  entry.initialize()

  entry.setValue("task", workOrderSysId)
  entry.setValue("user", gs.getUserID())
  entry.setValue("type", timeData.type) // work, travel, break

  entry.setValue("start_time", timeData.startTime)
  entry.setValue("end_time", timeData.endTime)

  // Calculate duration
  var start = new GlideDateTime(timeData.startTime)
  var end = new GlideDateTime(timeData.endTime)
  var duration = GlideDateTime.subtract(start, end)
  entry.setValue("duration", duration)

  // Notes
  entry.setValue("comments", timeData.notes)

  return entry.insert()
}

MCP Tool Integration

Available Tools

ToolPurpose
snow_query_tableQuery FSM tables
snow_execute_scriptTest FSM scripts
snow_artifact_manageFind configurations (action='find')

Example Workflow

javascript
// 1. Query open work orders
await snow_query_table({
  table: "wm_order",
  query: "state!=closed_complete^state!=cancelled",
  fields: "number,short_description,location,scheduled_start,assigned_to",
})

// 2. Find available technicians
await snow_execute_script({
  script: `
        var available = getAvailableTechnicians(
            new GlideDateTime(),
            new GlideDateTime().addHours(2),
            'hvac_certified',
            null
        );
        gs.info(JSON.stringify(available));
    `,
})

// 3. Get technician schedule
await snow_query_table({
  table: "wm_schedule_entry",
  query: "resource.user=technician_user_id^startONToday",
  fields: "work_order,start,end,state",
})

Best Practices

  1. Skills Matching - Match technician skills to requirements
  2. Territory Planning - Optimize service areas
  3. Route Optimization - Minimize travel time
  4. Mobile-First - Design for field use
  5. Real-Time Updates - GPS and status tracking
  6. Parts Management - Track inventory
  7. Time Tracking - Accurate time entries
  8. ES5 Only - No modern JavaScript syntax

Frequently asked questions

What does the Field Service AI skill do?

Build ServiceNow Field Service Management — wm_order work orders, wm_task tasks, wm_resource technicians with skills/territories, dispatch/auto-assignment, mobile status updates, and time entries.

Why use Field Service on TypingMind?

Because you install it once and use it with any model. Field Service is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Field Service in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/serac-labs/serac/tree/main/packages/skills/field-service. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Field Service?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Field Service?

As many as you like. As long as a model supports skills, you can use Field Service with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Field Service AI skill free?

Yes. It is published on GitHub by serac-labs under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇