sn_codesearch
Search ServiceNow script fields across code tables to find business rules, script includes, UI/client scripts, REST operations, ES modules, and ATF scripts; returns snippets around matches.
Instructions
Search across ServiceNow code artifacts — business rules, script includes, UI scripts, client scripts, scripted REST operations, ES modules and ATF step scripts. Returns matches with a snippet around the first hit; with no table, tables take turns so each is on page 1.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"search_term": "<search_term>",
"profile": "<profile>"
},
"name": "sn_codesearch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | No | Specific field to search (default: the table's script field) | |
| limit | No | Max total results (default 20, max 1000) | |
| table | No | Search one table only (default: all code tables you may read). Options: sys_script, sys_script_include, sys_ui_script, sys_script_client, sys_ws_operation, sys_module, sys_atf_step | |
| offset | No | Offset into the combined results (default 0) | |
| profile | Yes | Configured ServiceNow profile name (required; no default fallback). | |
| search_term | Yes | Text to search for in script fields |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| profile | Yes | Configured ServiceNow profile name (required; no default fallback). | |
| metadata | Yes |