โ†
AI for Skilled Trades & Home Services
Proficient ยท M20 ยท lesson 20 of 29 ยท queued
Preview โ€” browse every lesson free. Enroll to mark lessons complete, open partner links and save your progress. Login & enroll โ†’
Structured Output: JSON, Tables, Estimate Templates
๐Ÿ“–
now learning

Structured Output: JSON, Tables, Estimate Templates

15 min

The L3 Ch8 shop has the brand-voice system prompt locked, the Avoca / Rilla / Dispatch Pro / Hatch stack running, and the dashboard reading green. The next leverage is not more AI output โ€” it is cleaner AI output, in formats the ServiceTitan / Sera / HCP / FieldEdge / BuildOps stack can ingest directly. No more copy-paste. Structured output โ€” JSON for FSM ingest, tables for the dispatch board, estimate templates the Comfort Advisor's tablet renders โ€” turns AI from a content factory into an operating-system component. This lesson is the build instruction: the five output shapes a 2026 trades shop uses, the prompt patterns that produce them reliably, the verify checkpoints that catch AI's structural fabrications, and the integration paths into ServiceTitan, Sera, HCP, FieldEdge, and BuildOps. The L3 service manager builds this once and the rest of the shop's AI artifacts flow as data, not prose.

Why Structured Output Is the Next Leverage Line

The L1 shop deploys Avoca and reads the AI-generated call summary. The L2 shop deploys Rilla and reads scorecard commentary. The L3 shop reaches a different problem โ€” the AI's prose is fine; the ingestion is the bottleneck. The CSR copies the Avoca summary into ServiceTitan. The service manager copies the Rilla coaching points into the tech's log. The Comfort Advisor copies talk tracks into the estimate proposal. Each copy is a 30-second tax; at 80 artifacts per day across the shop that is 40 minutes of pure transcription. Each copy is a fresh fabrication surface โ€” the CSR may mis-paste, the service manager may abbreviate, the advisor may auto-correct a SEER number into a different SEER number. The verify catches some; the copies introduce drift the verify did not catch on the original artifact.

Structured output reframes the problem. The AI does not produce prose for a human to retype. The AI produces a JSON object the ServiceTitan import endpoint reads, a CSV row the dispatch board ingests, a Markdown table the Comfort Advisor's tablet renders, a Sera Systems job-template-conforming object the appointment auto-creates from. The human verifies the data, not the formatting. The 30-second pass becomes a 10-second pass. The 40 minutes of daily transcription drops to zero. The drift surface drops to one โ€” the original AI output โ€” and the verify catches it once.

Structured output is the L3 service manager's leverage line: build it once, every downstream artifact runs cleaner, and the shop's AI integration starts to look like operating infrastructure rather than a content factory.

The Five Output Shapes a 2026 Trades Shop Uses

Five structured output shapes cover 95% of the L3 shop's AI-output ingestion needs. Memorize them. Build the prompt templates for each. Verify against the FSM platform's import schema. The five are JSON for FSM ingest, CSV for batch operations, Markdown tables for human-plus-system review, estimate templates the tablet renders, and FSM-template-conforming objects the appointment auto-creates from.

JSON for FSM Ingest

JSON is the lingua franca of API ingestion. ServiceTitan's REST API accepts JSON for customer records, appointments, jobs, estimates, and dispatch overrides. Sera Systems accepts JSON for job templates and the AI-tagged custom field set. Housecall Pro ingests JSON for estimate line items and parts orders. FieldEdge accepts JSON for service tickets and technician routing. BuildOps ingests JSON for project budgets, equipment lists, and labor-tag schemas. Every FSM platform a 2026 trades shop runs has a JSON ingest path; the AI's job is to produce JSON that conforms to the platform's schema on the first pass.

The prompt pattern is direct: "Respond with valid JSON only. No prose, no markdown fence, no commentary. The object must conform to this schema: { customer_id, appointment_date, service_type (enum), tech_skill_tags, estimated_revenue, kill_reason or null, recovery_priority (enum) }." The AI returns the JSON; the integration layer pipes it directly into the ServiceTitan appointment creator or Sera Systems job builder. The verify happens on the data, not the format.

CSV for Batch Operations

CSV is the default for batch ops โ€” weekly tech-scorecard updates, monthly recall classification refreshes, quarterly attribution audit pulls, the L3 Ch2 dashboard's data-pipeline join layer. The FSM's batch-import wizard ingests CSV into the relevant table. Every L3 FSM platform supports CSV; the AI's job is to match the column ordering and data-type expectations exactly.

The prompt pattern names column ordering, data types, null handling, and encoding. "Produce CSV with columns in this order: tech_id, week_ending (YYYY-MM-DD), ride_along_count (integer), close_rate_percentage (1 decimal), average_ticket_dollars (no comma), mpr_percentage (1 decimal), recall_count, comments. Header row plus one row per tech. No prose. UTF-8. RFC 4180 quoting." Output drops into the dispatch board's import wizard or the Google Sheets pull that feeds the dashboard.

Markdown Tables for Human-Plus-System Review

Markdown tables split the difference between machine ingestion and human review. The Comfort Advisor's tablet renders them cleanly; Looker and Metabase render them in panels; Slack and Teams render them in messages. The L3 service manager uses Markdown tables for the weekly tech-scorecard summary, the daily recall-flag list, and the Friday dashboard's three diagnostic supplements.

The prompt pattern specifies shape, alignment, and headers. "Produce a Markdown table with three columns: Metric, This Week, Trailing 4-Week Average. Pipe separators. Hyphen separator row. Align Metric left, numbers right. Include eight rows: Booking %, After-Hours Capture %, Cost per Booked Call, Abandoned-Call %, AI-Recovered Revenue, CSR Show Rate, Morning Confirmation Completion, Recovery Rate Roll-Up. Percentages with %, dollars with $ and comma thousands. No prose around the table." Output drops into the Friday email body.

Estimate Templates the Tablet Renders

The Comfort Advisor's tablet renders proposal templates the customer signs in the driveway. ServiceTitan Mobile, Sera Mobile, HCP Mobile, and FieldEdge Mobile all support templated proposal generation from structured data. The AI produces the structured data โ€” SEER, warranty terms, financing options, rebates โ€” and the FSM app's proposal builder renders the customer-facing document with shop branding, counsel-approved disclosures, and signature block. The AI never produces the proposal directly; it produces the data that fills the template.

The prompt pattern is the strictest. "Produce a JSON object for the Trane XV20i 4-ton replacement: equipment_brand, equipment_model, seer_rating, afue_rating (or null), warranty_compressor_years, warranty_parts_years, warranty_labor_years, refrigerant_type, refrigerant_charge_pounds, section_25c_credit_dollars, state_rebate_dollars, utility_rebate_dollars, financing_apr_percentage, financing_term_months, financing_monthly_payment_dollars. Numeric fields source from the spec sheet, 2026 IRS Section 25C guidance, current state-utility rebate table, and Wisetack / GreenSky / Synchrony portal output. The template renders the document; you produce only the data."

FSM-Template-Conforming Objects

The fifth shape is the FSM platform's own object schema โ€” ServiceTitan's Appointment object, Sera's Job Template, HCP's Estimate Builder, FieldEdge's Service Ticket, BuildOps' Project Object. Each FSM platform publishes a schema spec for what fields its native objects accept; the AI produces objects that conform exactly. The integration layer pipes AI output into the FSM's creation endpoint with no transformation. The L3 service manager's job is to confirm the AI's output schema matches the FSM's expected schema, version by version, when the FSM updates.

The prompt pattern references the FSM's published schema by name and version. "Produce a JSON object conforming to ServiceTitan Appointment API v2.0 schema. Required: customerId, locationId, startTime (ISO 8601), duration (minutes), serviceTypeId (from the shop's lookup), priority (enum: Low, Normal, High, Emergency), assignedTechnicianId or null. Optional: customerNotes, internalNotes, tags, estimatedRevenue. Do not include fields outside the schema; the API will reject the call. Output JSON only."

Prompt Patterns That Produce Structured Output Reliably

Five prompt patterns make structured output reliable across the L3 stack. The L3 service manager builds these into the system prompt library and reuses across every workflow. Reliability matters because a single malformed JSON object can break a batch ingest run and fail 200 records simultaneously; the prompt patterns prevent the failure modes that produce malformed output.

Pattern One: The Schema-First Prompt

State the schema before the request. "Schema: { field_a: string, field_b: integer, field_c: enum [x, y, z] }. Request: produce one object matching this schema for the Avoca booking just received." The schema anchors the output; the AI fills it. Schemas-before-requests produce reliable structured output; requests-before-schemas produce prose-then-JSON-then-commentary noise.

Pattern Two: The Output-Only Instruction

Every prompt ends: "Output the JSON object only. No prose before. No prose after. No markdown code fence. No commentary." AI's default is to wrap structured output in a code fence and add commentary; ingest pipelines fail on the fence. The output-only instruction removes both; the ServiceTitan API ingests directly; the CSV wizard reads the first row as headers without confusion.

Pattern Three: The Enum Constraint

Any field with a discrete value set gets an enum constraint listing the allowed values. "service_type (enum: diagnostic, repair, replacement, maintenance, install)" or "kill_reason (enum: price_shock, slot_unavailable, after_hours_misunderstanding, callback_required, customer_no_show, other)". Without enum constraints, AI invents values ("emergency_diagnostic," "courtesy_callback") that break import validation and require manual cleanup.

Pattern Four: The Null Handling Rule

Every optional field has an explicit null rule. "If kill_reason is not applicable, set kill_reason to null. Do not omit the field. Do not use empty string. Do not use 'N/A.'" Without the rule, the AI omits, uses empty string, or stringifies a placeholder; the endpoint rejects or accepts a corrupt value. The single most common failure mode in 2026 AI-to-FSM ingestion.

Pattern Five: The Verify Line

Every prompt ends with a self-check: "Before finalizing, verify: (1) all required fields present, (2) enum values match allowed set, (3) numeric fields are numbers not strings, (4) date fields are ISO 8601, (5) entire output is valid JSON parseable by JSON.parse." Modern frontier models self-verify reliably when asked. Turns structured-output reliability from 80% to 98%.

Verify Checkpoints on Structured AI Output

Structured output does not exempt the artifact from the Cardinal Rule. The 30-second verify pass still applies โ€” but the checkpoints shift because the format is data rather than prose. Five checkpoints, adapted for structured output. The L3 service manager runs these on every new structured-output workflow during the first 30 days of deployment; after the workflow is stable, the verify drops to weekly sampling of 10 random artifacts.

Checkpoint One: schema conformance. Does the AI output match the FSM's published schema? Field names exact match (camelCase vs. snake_case is a frequent failure). Data types exact match. Required fields present. Enum values from the allowed set. The check happens at the integration layer's validation; the service manager reviews the validation log weekly for rejection patterns.

Checkpoint Two: numeric accuracy. The financing payment in the JSON object must match the Wisetack / GreenSky / Synchrony portal output. The SEER rating must match the Trane / Carrier / Lennox spec sheet. The Section 25C credit must match 2026 IRS guidance. Structured output formats numbers reliably; it does not guarantee numeric correctness. The verify still walks the numbers checkpoint from the Cardinal Rule lesson โ€” on JSON object fields rather than prose.

Checkpoint Three: identifier accuracy. customer_id matches the existing record. assignedTechnicianId references an actual tech in the dispatch board roster. locationId matches the customer's actual service address. Identifier mismatches produce silent corruption โ€” the FSM accepts the object, the workflow runs, the wrong customer gets the wrong appointment. The verify catches identifier drift before the integration pipes the object into the FSM.

Checkpoint Four: enum value verification. The AI's enum value matches the FSM's expected set. If service_type enum is [diagnostic, repair, replacement, maintenance, install], a "service_type": "emergency" is a rejection event. The check is mechanical and automatable; configure the integration layer to log enum rejections and review weekly for system-prompt updates.

Checkpoint Five: schema version verification. The FSM platform updated ServiceTitan Appointment API to v2.1 last month; the AI is still producing v2.0 objects; the v2.1 endpoint silently coerces missing required fields to defaults that break dispatch routing. Schema version verification is the quarterly discipline; the FSM's release notes are scanned, the system prompt is updated to match the current schema, and the integration layer's validation step is updated to enforce it.

Integration Paths into the L3 FSM Stack

Every FSM platform in the L3 stack has a defined integration path for AI-produced structured output. The L3 service manager builds the path once per platform during the structured-output rollout; after the path is live, every AI workflow flows through it. Five integration paths cover the L3 shop's FSM stack.

ServiceTitan Integration: REST API v2.x with JSON payload. The shop's integration layer (Zapier, Make, n8n, custom service-bus) receives AI output, validates against the Appointment / Customer / Estimate schema, and POSTs to the endpoint. ServiceTitan returns a 201 Created with the new object's ID; the integration layer logs the ID against the AI artifact for traceability โ€” the AI booking โ†’ ServiceTitan appointment โ†’ completed job revenue chain logged end-to-end, which is what the quarterly attribution audit reads.

Sera Systems Integration: REST API with JSON for job templates and a CSV wizard for batch ops. Sera's strength is the AI-tagged custom-field schema โ€” kill_reason, recovery_priority, AI_confidence_score, verify_pass_timestamp โ€” piped directly from AI output. Sera surfaces the AI-tagged data in dispatch views and the operations manager's daily report.

Housecall Pro Integration: API supports JSON for estimates and customer notes. The AI produces structured estimate data; the integration layer creates the HCP estimate object; the Comfort Advisor's HCP Mobile app renders the proposal from the structured data. HCP's templates are the rendering layer; the AI's structured output is the data layer.

FieldEdge and BuildOps: FieldEdge's API supports JSON for service tickets; the dispatch board renders the ticket with AI-produced context already attached. BuildOps supports JSON for commercial project objects, equipment lists, and labor-tag schemas โ€” the L3 commercial-residential hybrid shop uses BuildOps for commercial and ServiceTitan / Sera / HCP / FieldEdge for residential. The L3 service manager's prompt library has one template per FSM platform per workflow.

The Named Workflow: The Structured Output Build Week

The L3 service manager builds structured-output discipline in a five-day week. Day one: inventory the AI artifacts currently produced as prose that are downstream-consumed by an FSM ingest. Day two: select the top three highest-volume artifacts (Avoca booking confirmations, Rilla coaching scorecards, AI-drafted estimate data) and define the JSON / CSV / Markdown schema for each. Day three: rewrite the system prompts with the schema-first / output-only / enum / null / verify patterns. Day four: configure the integration layer (Zapier, Make, n8n, or custom service-bus) to pipe structured output into the FSM endpoint. Day five: run the first 50 artifacts, log validation rejections, refine the prompts, and document the workflow in the L3 prompt library.

The named workflow is "the structured output build week." Run it once per major AI workflow; after, the workflow runs without prose-to-data transcription. The 40 minutes of daily transcription drops to zero. The drift surface drops to one. The verify applies to the data, not the format.

Failure Modes and the Friday Rejection Log Review

Three failure modes kill structured-output reliability. The L3 service manager's Friday review catches each one before it compounds. The Friday rejection log is the 15-minute discipline that surfaces systemic failures and queues system-prompt updates for the following week.

Failure Mode One: Schema drift. The FSM platform updated its schema; the AI is producing the old one; the integration's validation is rejecting objects. Detection: rejection-log spike after an FSM release. Fix: update the system prompt's schema reference. Prevention: subscribe to FSM release notes; quarterly schema-version verification in L3 governance.

Failure Mode Two: Enum invention. The AI invents a value not in the allowed set. Detection: enum-validation failures in the log. Fix: explicit enum constraint plus verify line. Prevention: every enum field carries the constraint by default in the prompt library.

Failure Mode Three: Format wrapping. The AI wraps JSON in a markdown code fence or precedes with prose. Detection: JSON parsing failures at the integration layer. Fix: explicit output-only instruction; verify line includes "valid JSON parseable by JSON.parse." Prevention: structured-output template includes the instruction by default, no exception.

The Friday rejection log review takes 15 minutes. Pull the rejection log, categorize by failure mode, queue system-prompt updates for Monday deployment. The discipline keeps reliability at 98%+ across the L3 stack. Below 95% indicates an FSM schema change the team missed or prompt-template drift the Friday review needs to catch faster.

Structured Output and the L3 Leverage Line

The L3 Ch8 progression is system prompts (Lesson 1, brand voice) โ†’ structured output (this lesson, format discipline) โ†’ weekly audit (Lesson 3, accuracy discipline) โ†’ documentation and audit trail (Lesson 4, liability discipline). The four lessons compose the L3 service manager's operating system for AI quality at the workflow level. Structured output is the middle leg โ€” taking the brand voice from Lesson 1 and turning it into ingest-ready data the rest of the L3 stack consumes without retype.

The L3 shop that builds structured output captures three operational lifts. First, the 40 minutes of daily transcription drops to zero โ€” roughly 170 hours per year per shop reclaimed. Second, the drift surface drops from many to one. Third, the FSM platform's data quality improves measurably โ€” the dashboard's attribution audit catches fewer double-counting events, the quarterly governance review shows cleaner records, and the PE board's diligence pull surfaces a defensible operating-system artifact rather than a transcription mess. Build the schemas. Write the prompts. Configure the integration layer. Run the build week. Read the Friday rejection log. The L3 leverage line is structured output.

Key Takeaways

  • Structured output is the L3 leverage line โ€” Moves AI output from prose-for-humans-to-retype to data-for-systems-to-ingest. Eliminates the 40-minute daily transcription tax, drops the drift surface from many to one, and improves FSM data quality measurably.
  • Five output shapes cover 95% of L3 needs โ€” JSON for FSM ingest (ServiceTitan / Sera / HCP / FieldEdge / BuildOps), CSV for batch operations, Markdown tables for human-plus-system review, estimate templates the tablet renders, FSM-template-conforming objects per platform schema.
  • Schema-first prompt pattern โ€” State the schema before the request. Anchors output to the expected shape. Schemas-before-requests produce reliable structured output; requests-before-schemas produce prose-then-JSON-then-commentary noise.
  • Output-only instruction โ€” Every structured-output prompt ends with "Output the JSON object only. No prose before. No prose after. No markdown code fence. No commentary." Removes the default code-fence wrap that breaks ingest pipelines.
  • Enum constraint โ€” Discrete-value fields get explicit enum constraints listing the allowed values. Prevents AI from inventing a sixth value that fails import validation.
  • Null handling rule โ€” Every optional field has an explicit null rule ("set kill_reason to null, do not omit, do not use empty string, do not use 'N/A'"). The single most common AI-to-FSM ingestion failure mode in 2026.
  • Verify line โ€” Every prompt ends with a self-check instruction. Modern models self-verify when asked. Turns structured-output reliability from 80% to 98%.
  • Cardinal Rule still applies โ€” 30-second verify pass adapts to structured data: schema conformance, numeric accuracy, identifier accuracy, enum value verification, schema version verification.
  • Five integration paths โ€” ServiceTitan REST API, Sera Systems API + custom-field schema, HCP API for estimates and notes, FieldEdge API for service tickets, BuildOps API for commercial projects. Built once per platform; reused across every workflow.
  • The structured output build week โ€” Named workflow. Day 1 inventory artifacts. Day 2 define schemas. Day 3 rewrite prompts. Day 4 configure integration layer. Day 5 run 50 artifacts and refine. One build week per major workflow; permanent leverage after.
  • The Friday rejection log review โ€” 15-minute discipline. Pull integration layer rejection log, categorize by failure mode (schema drift, enum invention, format wrapping), queue system-prompt updates for Monday. Keeps reliability at 98%+.
  • The three operational lifts โ€” 170 hours per shop per year reclaimed; drift surface compresses to single origin point; FSM data quality measurably improves and supports defensible quarterly attribution audit and PE board diligence.