Document screening

From Happy-Technologies-LLC/happy-platform-skills · View interactive version

Document screening is an AI agent skill from the GitHub repository Happy-Technologies-LLC/happy-platform-skills. Screen inbound documents for completeness, policy risk, and routing readiness before extraction or case workflows

How to use this skill

Skill file

Document Screening

Overview

This skill adds a document screening stage before extraction or fulfillment workflows in ServiceNow®. It helps teams:

Use this when your intake process receives mixed document quality, high volume, or compliance-sensitive content.

Prerequisites

Procedure

Step 1: Build the Intake Queue

Collect newly submitted documents and classify by source, type, and priority.

Using MCP:

Tool: SN-Query-Table
Parameters:
  table_name: sys_attachment
  query: sys_created_on>=javascript:gs.hoursAgoStart(24)^table_nameISNOTEMPTY
  fields: sys_id,file_name,content_type,size_bytes,table_name,table_sys_id,sys_created_on,sys_created_by
  limit: 100
  order_by: sys_created_on

Using REST API:

GET /api/now/table/sys_attachment?sysparm_query=sys_created_on>=javascript:gs.hoursAgoStart(24)^table_nameISNOTEMPTY&sysparm_fields=sys_id,file_name,content_type,size_bytes,table_name,table_sys_id,sys_created_on,sys_created_by&sysparm_limit=100

Step 2: Match to Screening Template

Map each document to a known template and required evidence checklist.

Decision points:

Step 3: Run Screening Checks

Evaluate required attributes and extraction confidence signals.

Using MCP:

Tool: SN-Query-Table
Parameters:
  table_name: sn_doc_intelligence_extraction_result
  query: extraction=[extraction_sys_id]
  fields: field_name,extracted_value,confidence_score,validation_status
  limit: 200

Checks to apply:

Step 4: Assign Screening Outcome

Set one of three outcomes:

Using MCP:

Tool: SN-Create-Record
Parameters:
  table_name: task
  fields:
    short_description: "Document screening failed: missing required evidence"
    description: "File [file_name] failed screening checks. Review checklist and resubmit."
    priority: 3
    state: 1

Step 5: Record Audit Notes and Next Action

Document the screening rationale and the exact routing decision.

Tool Usage

| Tool | Purpose |

|---|---|

| SN-Query-Table | Retrieve attachments, templates, and extraction results |

| SN-Get-Record | Inspect source record context for submitted documents |

| SN-Create-Record | Create remediation tasks for failed screenings |

| SN-Update-Record | Update screening status and routing fields |

| SN-Add-Work-Notes | Persist decision rationale for auditability |

Best Practices

Troubleshooting

Screening Queue Is Empty

Symptom: No documents appear in intake query.

Cause: Time-window filter or source table filter is too restrictive.

Solution: Broaden query window and verify attachment source integration.

High False Failure Rate

Symptom: Most documents route to fail or conditional pass.

Cause: Confidence threshold or required field set is misaligned with real inputs.

Solution: Tune thresholds by document type and add exception handling rules.

Related Skills

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.