Natural-Language Queries

SkillSearch

Use parser-verified Happy Platform MCP 5.1 natural-language search phrases and fall back to precise encoded table queries

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Natural-Language Queries skill

What this skill tells your AI

The instructions your AI receives, as published by happy-technologies-llc/happy-platform-skills in skills/itsm/natural-language-queries/SKILL.md and read by ahel’s review.

Overview

Happy Platform MCP 5.1 converts a bounded set of natural-language phrases into ServiceNow encoded conditions. Use SN-Natural-Language-Search for the atomic, parser-verified patterns below. Use SN-Query-Table whenever exact operators, multiple branches, exclusions, field-specific text behavior, or deterministic ordering matter.

The authoritative fixtures are packaged in contracts/happy-platform-mcp-5.1.0-natural-language.json and can be checked against the sibling MCP source with npm run contract:nl-check.

Prerequisites

  • Happy Platform MCP 5.1.0 configured for the target instance
  • Read access to the target table
  • The exact table name
  • A small result limit and explicit return fields for exploratory searches

Procedure

1. Choose one parser-verified phrase

The following atomic phrases parse completely in MCP 5.1.0:

IntentSupported phraseEncoded condition produced
Priority labelhigh prioritypriority=2
Priority numberP1 or priority 2priority=1 or priority=2
Impacthigh impactimpact=1
Urgencymedium urgencyurgency=2
Current userassigned to meassigned_to=javascript:gs.getUserID()
No assigneeunassignedassigned_toISEMPTY
Named assigneeassigned to John Smithassigned_to.nameLIKEJohn Smith
Opened todayopened todaysys_created_on>javascript:gs.daysAgoStart(0)
Opened recentlyopened in the last 7 dayssys_created_on>javascript:gs.daysAgo(7)
Recent recordrecentsys_created_on>javascript:gs.daysAgo(7)
Active recordactiveactive=true
Description textdescription contains authenticationdescriptionLIKEauthentication
General contentabout SAPshort_descriptionLIKESAP^ORdescriptionLIKESAP
Exact numbernumber is INC0012345number=INC0012345
Callercaller is John Smithcaller_id.nameLIKEJohn Smith
Categorycategory is SoftwarecategoryLIKESoftware
Assignment groupassignment group is Network Teamassignment_group.nameLIKENetwork Team

The mappings above are literal v5.1 parser outputs. For example, “high” maps to priority value 2, while “critical” maps to value 1.

2. Execute a bounded search

Always provide table; the v5.1 argument is not named table_name. Specify the target instance for live or concurrent work.

Tool: SN-Natural-Language-Search
Parameters:
  table: incident
  query: P1
  fields: sys_id,number,short_description,priority
  limit: 10
  instance: dev

Inspect encodedQuery, matchedPatterns, unmatchedText, and the returned records. Treat non-empty unmatchedText as a failed validation, even if the tool also returns an encoded condition.

3. Keep exploratory calls atomic

Use a separate bounded call for each independent question:

Tool: SN-Natural-Language-Search
Parameters:
  table: incident
  query: unassigned
  fields: sys_id,number,assigned_to
  limit: 10
  instance: dev
Tool: SN-Natural-Language-Search
Parameters:
  table: incident
  query: opened in the last 7 days
  fields: sys_id,number,sys_created_on
  limit: 10
  instance: dev

Do not infer that two separately supported phrases can be freely composed. The v5.1 parser processes each pattern at most once, and leftover words can change or weaken the result.

4. Use encoded queries for precision

When the requirement includes exact comparisons, exclusions, multiple values, field-specific text operators, or deterministic ordering, construct and review an encoded query and use SN-Query-Table:

Tool: SN-Query-Table
Parameters:
  table_name: incident
  query: priority=1^state!=7^assigned_toISEMPTY^ORDERBYDESCsys_created_on
  fields: sys_id,number,short_description,priority,state,assigned_to,sys_created_on
  limit: 25
  instance: dev

The encoded-query path is also the correct choice for automation because its meaning does not depend on pattern extraction from free-form text.

5. Validate non-incident targets explicitly

Natural-language parsing uses the supplied table for table-dependent behavior. Never rely on the default when searching another table:

Tool: SN-Natural-Language-Search
Parameters:
  table: change_request
  query: recent
  fields: sys_id,number,short_description,sys_created_on
  limit: 10
  instance: dev

For unfamiliar tables, prefer an encoded SN-Query-Table query until the natural-language result has been verified against known records.

Tool Usage

ToolUse
SN-Natural-Language-SearchBounded exploration with one parser-verified phrase
SN-Query-TableExact, repeatable encoded-query execution

Best Practices

  • Provide table, fields, limit, and instance explicitly.
  • Start with one atomic phrase from the packaged fixture contract.
  • Require empty unmatchedText before trusting the parser result.
  • Compare exploratory results with known records before expanding the limit.
  • Use encoded queries for production automation and complex conditions.
  • Keep field selection minimal to reduce payload and accidental data exposure.

Troubleshooting

No encoded condition is returned

The phrase did not match a v5.1 pattern. Use one fixture-backed atomic phrase or switch to SN-Query-Table with a reviewed encoded query.

A condition is returned with leftover text

The parser matched only part of the request. Do not treat the result as an equivalent query. Reduce the request to one verified phrase or use an encoded query.

The returned condition has the wrong meaning

Stop using that phrase. Natural-language matching can accept words in an unintended pattern. Express the requirement directly as an encoded query and verify it on a small result set.

A non-incident search returns incident-shaped results

Confirm the call uses table, not an obsolete argument name, and that the explicit table value is correct.

Related Skills

  • itsm/incident-triage
  • itsm/quick-reference
  • admin/generic-crud-operations

Signals

GitHub stars
38
Forks
13
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
natural-language-queries
Source
github.com/happy-technologies-llc/happy-platform-skills