cursorrules

A set of working rules for using tools that operate on ServiceNow, a platform for managing IT requests, incidents, and business workflows. It explains authentication and the query syntax used to find records in ServiceNow tables.

In plain words
What is it for?
Querying tables, counting records, running aggregate searches, filtering by fields or states, sorting results, and choosing which ServiceNow instance to use.
Why use it?
It helps an agent send correctly formed ServiceNow requests and avoid errors caused by missing access details or invalid filters.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sonisoft-cnanda/now-sdk-ext-mcp/cursorrules
Clone the repo
git clone --depth 1 https://github.com/sonisoft-cnanda/now-sdk-ext-mcp

Made for: Cursor.

Per session 2,588 This file is loaded in full into every session.
When invoked 2,588 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02588 $0.02588
Opus 5 $0.01294 $0.01294
Sonnet 5 $0.00518 $0.00518
Haiku 4.5 $0.00259 $0.00259

Measured 2d ago against content hash 331773b778ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/ai-agents/.cursorrules · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.

NEX MCP Server Rules — ServiceNow Platform Automation

You have access to the now-sdk-ext-mcp MCP server for ServiceNow platform operations. Use these rules when interacting with ServiceNow instances.

Authentication

Every tool accepts an optional instance parameter (auth alias). If omitted, the SN_AUTH_ALIAS environment variable is used. If neither is available, the tool returns an error.

Encoded Query Syntax

Most query tools accept a query parameter using ServiceNow encoded query format:

  • =, !=, >, <, >=, <= — comparisons
  • LIKE, STARTSWITH, ENDSWITH — string matching
  • IN, NOT IN — list membership: stateIN1,2,3
  • ISEMPTY, ISNOTEMPTY — null checks
  • INSTANCEOF — table hierarchy: sys_class_nameINSTANCEOFtask
  • ^ — AND: active=true^priority=1
  • ^OR — OR: priority=1^ORpriority=2
  • ORDERBY<field> / ORDERBYDESC<field> — sorting

Tool Reference

Query & Data

Tool Description Key Parameters
query_table Query any table table, query, fields, limit, display_value
count_records Count records (efficient) table, query
aggregate_query Stats (AVG/MIN/MAX/SUM) table, count, avg_fields, sum_fields
aggregate_grouped Grouped aggregates table, group_by, count, having
query_syslog Query system logs level, source, limit

Schema & Discovery

Tool Description Key Parameters
lookup_table Search for tables search_term
lookup_columns List table columns table, search_term
discover_table_schema Full table schema table, include_choices, include_business_rules
explain_field Explain a field table, field
list_instance_tables List tables name_prefix, scope
list_plugins List plugins name_prefix, active_only

Script Execution

Tool Description Key Parameters
execute_script Run JS via Scripts - Background script, scope (default: global), params

Read the full file on GitHub · 230 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 230 lines · 2,588 tokens per session scan A 331773b778ff

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository sonisoft-cnanda/now-sdk-ext-mcp (16 stars, last pushed 4d ago), licensed MIT. It adds 2,588 tokens to every session, about $0.0129 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.