/servicenow:analyzing-accessfrom ServiceNow developer data plane
Reviews ServiceNow role assignments and access denials. Lists admin/security_admin holders, direct vs group grants, inactive user roles, and diagnoses 401/403 errors, empty results, and missing fields via dot-walk queries.
Ships in ServiceNow developer data plane. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two jobs: review role and group hygiene across users, and explain why a call was denied or came back incomplete. Everything here is read-only. See references/access-errors.md for the denial messages and what each one means, and references/acl-evaluation.md for how ServiceNow decides access.
| Table | What it answers | Readable with |
|---|---|---|
sys_user_has_role | Which user holds which role, directly or inherited | itil (all users' rows); snc_read_only alone gets 403 |
sys_user_grmember | Group membership; group names come from sys_user_group through group.name | itil |
sys_group_has_role | Which roles a group grants | itil |
sys_user | active, last_login_time | snc_read_only |
sys_security_acl | The ACL rules themselves | admin / security_admin only: 403 for least-privilege identities |
Role names come through dot-walks (role.name). The role table itself (sys_user_role) usually hides some or all of its rows from least-privilege identities, so role.name can come back empty (observed for admin and security_admin) while a filter on role.name=admin still matches. Workflow 5 covers dot-walks and their limits.
list_records adds a warning): possibly hidden by an ACL, not proof that nothing exists.Progress checklist:
- [ ] List active admin and security_admin grants
- [ ] Flag inactive users and stale logins among them
- [ ] Separate direct grants from group grants
- [ ] Report counts and the accounts to review
list_records(table_name="sys_user_has_role", query="role.nameINadmin,security_admin^state=active", fields="user.user_name,user.active,user.last_login_time,role,role.name,inherited", limit=200)
If role.name comes back empty, tell the two roles apart by the role sys_id, or run the query once per role.inherited=false is a direct grant. An inherited row came through a group or through a role that contains this one. To find the group, intersect the user's groups with the groups that grant the role (workflow 2, step 3):
list_records(table_name="sys_user_grmember", query="user.user_name=<user>", fields="group.name", limit=100)
granted_by still names the group on some instances, but ServiceNow has deprecated it, so don't rely on it.ServiceNow recommends granting roles through groups, so that moving a person between teams moves their access.
list_records(table_name="sys_user_has_role", query="inherited=false^state=active^user.active=true", fields="user.user_name,role.name", limit=500)
list_records(table_name="sys_group_has_role", query="role.name=<role>", fields="group.name,role.name,inherits", limit=50)
list_records(table_name="sys_user_has_role", query="user.active=false^state=active", fields="user.user_name,role.name,inherited", limit=500)
list_records(table_name="sys_user", query="active=true^last_login_timeRELATIVELT@dayofweek@ago@90", fields="user_name,last_login_time", limit=500)
list_records(table_name="sys_user", query="active=true^last_login_timeISEMPTY", fields="user_name", limit=500)
user.user_name). Integration and service accounts may never log in interactively, so confirm what an account is before calling it stale.Progress checklist:
- [ ] Capture the exact status and message
- [ ] Classify it with references/access-errors.md
- [ ] Check the caller's own roles
- [ ] Say what is and isn't assessable, and the next step
references/access-errors.md.get_current_user(). It lists direct grants; inherited roles come through groups.references/acl-evaluation.md. The ACL rules themselves need admin. Without them, say the rule-level answer is not assessable with this identity, and point an admin to ServiceNow's Access Analyzer, or to the Access Analysis agent where it is licensed.A dot-walk (group.name, user.department.name) reads a field of the referenced record in the same call. Use dot-walks in fields= and query= instead of reading two or three tables and joining them by sys_id yourself.
Progress checklist:
- [ ] Start from the table that holds the link: a membership or a grant
- [ ] Put the dot-walked fields in fields= and the conditions in query=
- [ ] Count people, not rows, when the question is "how many people"
- [ ] Check empty and missing dot-walked values before reporting
list_records(table_name="sys_user_grmember", query="group.name=<group>^user.active=true", fields="group.name,user.user_name,user.name,user.active,user.department.name", limit=200, order_by="user.name")
Drop ^user.active=true to see deactivated users who are still members (workflow 3).list_records(table_name="sys_group_has_role", query="role.name=<role>^group.active=true", fields="group,group.name,inherits", limit=100)
list_records(table_name="sys_user_grmember", query="groupIN<group_sys_id>,<group_sys_id>^user.active=true", fields="group.name,user.user_name,user.active", limit=500, order_by="group.name")
Filter on the group sys_ids, not on group names: a name can hold a comma, and IN splits on commas. Direct holders are the inherited=false rows of workflow 2. An inherited grant with no matching group came through a role that contains this one.aggregate_records(table_name="sys_user_has_role", query="role.name=<role>^state=active", group_by="user")
Each group in the result is one person, so the number of groups is the number of people. A plain count (the same call without group_by) counts grants, not people. One person can hold the same role directly and through several groups, and each grant is its own sys_user_has_role row: on a Brazil instance, one user held itil in two active rows, one direct and one inherited. display_value="all" shows user names next to the sys_ids. If aggregate_records is refused, list the rows with fields="user" and count the distinct values. Don't count people with an RLQUERY on sys_user: the conditions inside the block were ignored, so it counted every user with any role.list_records names it in its warning, also when it appears only in query=.role.name came back empty, or not at all, on admin grants, while role.name=admin still matched them. When every row leaves it out, the warning names the dot-walk and says the condition may still have applied: compare against a value that can't match (role.name=no_such_role) to tell. Report an empty dot-walked value as "not readable or not set", and add the reference itself (role, group, user) to fields=: its sys_id still comes back.limit even when more readable records exist: the Table API applies the limit before ACLs remove rows. Keep paging with offset until a page comes back empty.aggregate_records can count rows that list_records won't return. A count above the rows you can list means row-level ACLs are hiding records.list_records and list_ci check the fields you filter on in query= as well as those in fields=: if one is hidden or misspelled, the warning names it. A dot-walk in query= is checked whole only when you pass fields=.script or condition bodies, or any field that can hold credentials, even with an admin identity. Names and counts answer hygiene questions.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
servicenow, access-review, role-audit, acl-diagnosis, user-hygiene
npx claudepluginhub jschuller/mcp-server-servicenow --plugin servicenow4 skills in this plugin
/exploring-tablesExploring any ServiceNow table: schema, field types, sample records, relationships, data patterns, a record's history (work notes, comments, field changes), and what touches a table or field (business rules, client scripts, UI policies, ACLs, script includes). Use when the user mentions tables, schemas, fields, data dictionary, sys_dictionary, sys_db_object, table structure, 'what fields does X have', a record's work notes, comments, journal or audit trail, where a table or field is used, what would break if it changed, or wants to understand a ServiceNow table they haven't worked with before./reviewing-update-setsReviewing, analyzing, and comparing ServiceNow update sets before promotion, singly or in batches. Shows changes, risks, dependencies, and conflicts. Use when the user mentions update sets, customizations, promotion, code review, change tracking, pre-deployment review, sys_update_xml, customer updates, 'what changed in this update set', or 'is this safe to promote'./servicenow-cmdbAuditing the CMDB as a data model: CI class hierarchy, raw relationships, CMDB health scorecards, data quality (duplicates, orphans, staleness, missing fields) and CSDM 5 conformance. Use when the user mentions CMDB health, CMDB audit, data quality, duplicates, orphaned or stale CIs, CI classes, relationships in cmdb_rel_ci, CSDM, service taxonomy, Data Foundations, compliance scores, or 'how clean is our CMDB'.Other plugins' skills for the same job